mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-27 16:45:19 +00:00
Fix unsave in send_animation
This commit is contained in:
parent
2de16e8226
commit
cf610bf2c0
@ -262,18 +262,13 @@ class SendAnimation:
|
|||||||
is_scheduled=isinstance(i, raw.types.UpdateNewScheduledMessage)
|
is_scheduled=isinstance(i, raw.types.UpdateNewScheduledMessage)
|
||||||
)
|
)
|
||||||
|
|
||||||
if unsave:
|
if unsave and message.animation:
|
||||||
document = message.animation or message.document
|
|
||||||
document_id = utils.get_input_media_from_file_id(
|
document_id = utils.get_input_media_from_file_id(
|
||||||
document.file_id, FileType.ANIMATION
|
message.animation.file_id,
|
||||||
|
FileType.ANIMATION,
|
||||||
).id
|
).id
|
||||||
|
|
||||||
await self.invoke(
|
await self.invoke(raw.functions.messages.SaveGif(id=document_id, unsave=True)) # type: ignore[arg-type]
|
||||||
raw.functions.messages.SaveGif(
|
|
||||||
id=document_id,
|
|
||||||
unsave=True
|
|
||||||
)
|
|
||||||
)
|
|
||||||
|
|
||||||
return message
|
return message
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user