Answer the question
In order to leave comments, you need to log in
Why is Dispather needed in Aiogram?
The code:
bot = Bot(token = TOKEN)
mybot = Dispatcher(bot)
@mybot.message_handler(commands = 'start')
async def greetings(message: types.Message):
stick = open('settings\\Greetings_from_Steve_Jobs_for_users_of_my_second_python_bot_for_telegram.webp', 'rb')
await bot.send_sticker(message.chat.id, stick)
stick.close()
await bot.send_sticker(message.chat.id, stick)
? Answer the question
In order to leave comments, you need to log in
It is not necessary to go so deep at this stage of studying the library.
In short Dispatcher accepts all updates and processes them.
You can send messages as you like, even await mybot.bot.send_sticker or await bot.send_sticker, as long as everything is imported correctly
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question