Я попробовал это, но в нем изображен только standart Telegram Bot Alert Bot. < /p>
Код: Выделить всё
const allowsWriteToPm = window.Telegram.WebApp.initDataUnsafe.user.allows_write_to_pm;
if (!allowsWriteToPm) {
window.Telegram.WebApp.requestWriteAccess(function(ctx) {
console.log("[TG] requestWriteAccess: " + ctx);
if (!ctx || ctx !== "allowed" && String(ctx) !== "true"){
return;
}
TG.trySendGreetMsg();
});
} else {
TG.trySendGreetMsg();
}
Подробнее здесь: https://stackoverflow.com/questions/795 ... pup-window
Мобильная версия