Бот для капчи в чатах
Roman Sergienko
11 hours ago 2dc33598d80358dd4c8b618cb0d42aa2054f2005
Use KeyboardButton with web_app for /panel command to open Mini App
1 files modified
10 ■■■■■ changed files
cmds.py 10 ●●●●● patch | view | raw | blame | history
cmds.py
@@ -1,6 +1,6 @@
from aiogram import F, types
from aiogram.filters import Command, CommandObject
from aiogram.types import InlineKeyboardButton, InlineKeyboardMarkup, WebAppInfo
from aiogram.types import InlineKeyboardButton, InlineKeyboardMarkup, KeyboardButton, ReplyKeyboardMarkup, WebAppInfo
import db
import cfg
@@ -106,12 +106,12 @@
    if not await check_perm(message.chat.id, message.from_user.id, P_CFG):
        await message.answer("У вас нет доступа к панели.")
        return
    keyboard = InlineKeyboardMarkup(inline_keyboard=[[
        InlineKeyboardButton(
    keyboard = ReplyKeyboardMarkup(keyboard=[[
        KeyboardButton(
            text="Открыть панель",
            url=f"{cfg.WEB_BASE_URL}/miniapp?chat_id={message.chat.id}",
            web_app=WebAppInfo(url=f"{cfg.WEB_BASE_URL}/miniapp?chat_id={message.chat.id}"),
        )
    ]])
    ]], one_time_keyboard=True)
    await message.answer("Панель управления чатом:", reply_markup=keyboard)