X
X
XWR2021-06-13 14:09:24
Python
XWR, 2021-06-13 14:09:24

How to convert telebot script to aiogram?

Hello, please help me to convert this telebot script into aiogram

@bot.message_handler(content_types=["text"])
def skye(message):
    if message.text.lower() in ('пока', 'гудбай'):
    	bot.send_message(message.chat.id, 'пока')
    elif message.text.lower() in ('привет', 'хай'):
    	bot.send_message(message.chat.id, 'привет')


I will be grateful if you help

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Petrenko, 2021-06-13
@Termoslik

@dp.message_handler(content_types=types.ContentTypes.TEXT)
async def skye(message: types.Message):
    if message.text.lower() in ('пока', 'гудбай'):
        await message.answer('пока')
    if message.text.lower() in ('привет', 'хай'):
        await message.answer('привет')

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question