def main() -> None: # Logging logging.basicConfig( level=logging.DEBUG if config.DEBUG else logging.INFO, format="[%(asctime)s] [%(levelname)s] [%(name)s] %(message)s", ) # Bot bot = Bot(token=os.environ.get("TOKEN")) dp = Dispatcher(bot, storage=MemoryStorage()) handlers.setup(dp) middleware.setup(dp) # Server app = web.Application() app.add_routes(uniforms.routes) # Run everything loop = asyncio.get_event_loop() loop.run_until_complete(dp.skip_updates()) loop.create_task(dp.start_polling()) web.run_app( app=app, host="0.0.0.0", port=config.TGBOT_PORT, )
keybord.add(button_1) await message.answer("есть", reply_markup=keybord) @dp.message_handler(content_types=['text', 'document']) #async def command(message:types.Message): # markup = types.InlineKeyboardMarkup() # switch_button = types.InlineKeyboardButton(text='Try',callback_data='1') # markup.add(switch_button) #print(message.text) #await message.answer("Я еще тупенький бот и не знаю много, поэтому я не понимаю вашу команду.",reply_markup=markup) @dp.callback_query_handler(lambda call: "пми" in call.data) async def callback_inline(call: CallbackQuery): await call.answer("yesssssss") # Если сообщение из чата с ботом print(call.data) # if call.message: # if call.data == "1": # await call.answer("good") # Если сообщение из инлайн-режима #elif call.inline_message_id: # if call.data == "t": # await call.answer("nooo good") print("start") executor.start_polling(dp, skip_updates=True) Dispatcher.skip_updates(dp)