Answer the question
In order to leave comments, you need to log in
Why is the subsequent handler not being processed?
I can't understand why the subsequent handler is not processed, here is the code:
import asyncio
from aiogram import Bot, Dispatcher, executor
from aiogram.types import Message
from Config import BOT_TOKEN, admin_id
loop = asyncio.get_event_loop()
bot = Bot(BOT_TOKEN)
dp = Dispatcher(bot, loop=loop)
async def send_to_admin(dp):
await bot.send_message(chat_id=admin_id, text="Hooray!")
lw=["yes","yeah"]
@dp.message_handler()
async def delete(message: Message):
if message.text.lower()=="kod":
await message.delete()
@dp.message_handler()
async def echo1(message: Message):
for n in lw:
if message.text[0]=="/":
await message.answer(text="Enter your name")
return
if n in message.text.lower():
await message.answer(text="OK")
return
if "p" in message.text.lower():
await message.answer(text="Let")
return
if __name__=="__main__":
executor.start_polling(dp, on_startup=send_to_admin, skip_updates=True)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question