Тема: Допомога з python aiogram
Пишу Telegram-бота, при додаванні Web-app виникла помилка не знаю як виправити.
Код:
from aiogram.types import CallbackQuery
from aiogram import Bot, Dispatcher, executor
from aiogram.contrib.fsm_storage.memory import MemoryStorage
from aiogram.dispatcher.filters.state import StatesGroup, State
from aiogram.types import Message
from aiogram_dialog import Window, Dialog, DialogRegistry, DialogManager, StartMode
from aiogram_dialog.widgets.kbd import Button
from aiogram_dialog.widgets.kbd import Url
from aiogram_dialog.widgets.text import Const
storage = MemoryStorage()
bot = Bot(token='тут_токен')
dp = Dispatcher(bot, storage=storage)
registry = DialogRegistry(dp)
class MySG(StatesGroup):
main = State()
async def uid_clicked(c: CallbackQuery, button: Button, manager: DialogManager):
await c.answer(f"Your ID is: {c.from_user.id} ")
main_window = Window(
Const("Hello, user"),
Button(Const("My balance"), Const("https://телеґрам/PayeercomBot"), id="ID038374" ),
Button(Const("My id"), on_click=uid_clicked, id="ID84746"),
Url(Const("Library developer"), web_app=WebAppInfo('https://github.com/Tishka17/aiogram_dialog/'), id="ID8374847"),
state=MySG.main,
)
dialog = Dialog(main_window)
registry.register(dialog)
@dp.message_handler(commands=["start"])
async def start(m: Message, dialog_manager: DialogManager):
await dialog_manager.start(MySG.main, mode=StartMode.RESET_STACK)
if __name__ == '__main__':
executor.start_polling(dp, skip_updates=True)