Fix fantom message with exception when trying to raise MessageNotModified

pull/1/head
Hikari 2022-04-16 20:29:41 +00:00
parent fa1ff8527a
commit 5b7a869f26
No known key found for this signature in database
GPG Key ID: 5FA52ACBB2AD964D
1 changed files with 7 additions and 6 deletions

View File

@ -210,12 +210,13 @@ class Utils(InlineUnit):
),
)
except MessageNotModified:
try:
await query.answer()
except InvalidQueryID:
pass # Just ignore that error, bc we need to just
# remove preloader from user's button, if message
# was deleted
if query:
try:
await query.answer()
except InvalidQueryID:
pass # Just ignore that error, bc we need to just
# remove preloader from user's button, if message
# was deleted
except RetryAfter as e:
logger.info(f"Sleeping {e.timeout}s on aiogram FloodWait...")