mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-09 01:15:31 +00:00
Provide to cancel next message waiter.
This commit is contained in:
parent
bf9657dfc5
commit
03c7e4a6d8
4 changed files with 39 additions and 9 deletions
|
|
@ -37,7 +37,12 @@ async def save_sticker(message):
|
|||
# It can only be a sticker
|
||||
msg = await dp.next_message(message,
|
||||
content_types=[ContentType.STICKER],
|
||||
otherwise=handle_bad_message)
|
||||
otherwise=handle_bad_message,
|
||||
include_cancel=True)
|
||||
|
||||
if not msg:
|
||||
# If user send /cancel
|
||||
return await message.reply('Canceled.')
|
||||
|
||||
# Download file to memory (io.BytesIO)
|
||||
photo = await bot.download_file(msg.sticker.file_id)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue