From cf610bf2c0570229486a7ab7353eb5a21cc7210d Mon Sep 17 00:00:00 2001 From: KurimuzonAkuma Date: Wed, 18 Oct 2023 15:58:22 +0300 Subject: [PATCH] Fix unsave in send_animation --- pyrogram/methods/messages/send_animation.py | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/pyrogram/methods/messages/send_animation.py b/pyrogram/methods/messages/send_animation.py index 57e8d5e7..a5f4a7e6 100644 --- a/pyrogram/methods/messages/send_animation.py +++ b/pyrogram/methods/messages/send_animation.py @@ -262,18 +262,13 @@ class SendAnimation: is_scheduled=isinstance(i, raw.types.UpdateNewScheduledMessage) ) - if unsave: - document = message.animation or message.document + if unsave and message.animation: document_id = utils.get_input_media_from_file_id( - document.file_id, FileType.ANIMATION + message.animation.file_id, + FileType.ANIMATION, ).id - await self.invoke( - raw.functions.messages.SaveGif( - id=document_id, - unsave=True - ) - ) + await self.invoke(raw.functions.messages.SaveGif(id=document_id, unsave=True)) # type: ignore[arg-type] return message