1717# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
1818
1919import logging
20+ import io
2021import os
2122import re
2223from datetime import datetime
23- from typing import Union , BinaryIO , List , Optional , Callable
24+ from typing import Union , List , Optional , Callable
2425
2526import pyrogram
2627from pyrogram import StopTransmission , enums , raw , types , utils
@@ -35,7 +36,7 @@ class SendAnimation:
3536 async def send_animation (
3637 self : "pyrogram.Client" ,
3738 chat_id : Union [int , str ],
38- animation : Union [str , BinaryIO ],
39+ animation : Union [str , "io.BytesIO" ],
3940 caption : str = "" ,
4041 parse_mode : Optional ["enums.ParseMode" ] = None ,
4142 caption_entities : List ["types.MessageEntity" ] = None ,
@@ -45,7 +46,7 @@ async def send_animation(
4546 duration : int = 0 ,
4647 width : int = 0 ,
4748 height : int = 0 ,
48- thumb : Union [str , BinaryIO ] = None ,
49+ thumb : Union [str , "io.BytesIO" ] = None ,
4950 file_name : str = None ,
5051 disable_notification : bool = None ,
5152 reply_parameters : "types.ReplyParameters" = None ,
@@ -77,7 +78,7 @@ async def send_animation(
7778 For your personal cloud (Saved Messages) you can simply use "me" or "self".
7879 For a contact that exists in your Telegram address book you can use his phone number (str).
7980
80- animation (``str`` | ``BinaryIO` `):
81+ animation (``str`` | :obj:`io.BytesIO `):
8182 Animation to send.
8283 Pass a file_id as string to send an animation that exists on the Telegram servers,
8384 pass an HTTP URL as a string for Telegram to get an animation from the Internet,
@@ -113,7 +114,7 @@ async def send_animation(
113114 height (``int``, *optional*):
114115 Animation height.
115116
116- thumb (``str`` | ``BinaryIO` `, *optional*):
117+ thumb (``str`` | :obj:`io.BytesIO `, *optional*):
117118 Thumbnail of the animation file sent.
118119 The thumbnail should be in JPEG format and less than 200 KB in size.
119120 A thumbnail's width and height should not exceed 320 pixels.
0 commit comments