From b1c12c323236e9a6a8f5e60a5eb0d3aff9808ffc Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Mon, 6 Aug 2018 21:38:44 +0200 Subject: [PATCH] Rename GIF to Animation --- pyrogram/__init__.py | 2 +- pyrogram/client/ext/utils.py | 6 +++--- pyrogram/client/methods/download_media.py | 2 +- pyrogram/client/types/__init__.py | 2 +- pyrogram/client/types/media/__init__.py | 2 +- .../client/types/media/{gif.py => animation.py} | 16 ++++++++-------- pyrogram/client/types/message.py | 8 ++++---- 7 files changed, 19 insertions(+), 19 deletions(-) rename pyrogram/client/types/media/{gif.py => animation.py} (82%) diff --git a/pyrogram/__init__.py b/pyrogram/__init__.py index 24bdc1a5..a822524c 100644 --- a/pyrogram/__init__.py +++ b/pyrogram/__init__.py @@ -30,7 +30,7 @@ from .client.types import ( Audio, Chat, ChatMember, ChatMembers, ChatPhoto, Contact, Document, InputMediaPhoto, InputMediaVideo, InputMediaDocument, InputMediaAudio, InputMediaAnimation, InputPhoneContact, Location, Message, MessageEntity, Dialog, Dialogs, Photo, PhotoSize, Sticker, Update, User, - UserProfilePhotos, Venue, GIF, Video, VideoNote, Voice, CallbackQuery, Messages, ForceReply, + UserProfilePhotos, Venue, Animation, Video, VideoNote, Voice, CallbackQuery, Messages, ForceReply, InlineKeyboardButton, InlineKeyboardMarkup, KeyboardButton, ReplyKeyboardMarkup, ReplyKeyboardRemove ) from .client import ( diff --git a/pyrogram/client/ext/utils.py b/pyrogram/client/ext/utils.py index a99ee066..c1d859d0 100644 --- a/pyrogram/client/ext/utils.py +++ b/pyrogram/client/ext/utils.py @@ -293,7 +293,7 @@ def parse_messages( venue = None audio = None voice = None - gif = None + animation = None video = None video_note = None sticker = None @@ -432,7 +432,7 @@ def parse_messages( elif types.DocumentAttributeAnimated in attributes: video_attributes = attributes.get(types.DocumentAttributeVideo, None) - gif = pyrogram_types.GIF( + animation = pyrogram_types.Animation( file_id=encode( pack( ". +from .animation import Animation from .audio import Audio from .contact import Contact from .document import Document -from .gif import GIF from .location import Location from .photo import Photo from .photo_size import PhotoSize diff --git a/pyrogram/client/types/media/gif.py b/pyrogram/client/types/media/animation.py similarity index 82% rename from pyrogram/client/types/media/gif.py rename to pyrogram/client/types/media/animation.py index 5172aae2..85d5a365 100644 --- a/pyrogram/client/types/media/gif.py +++ b/pyrogram/client/types/media/animation.py @@ -19,27 +19,27 @@ from pyrogram.api.core import Object -class GIF(Object): - """This object represents a GIF file. +class Animation(Object): + """This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound). Args: file_id (``str``): Unique identifier for this file. width (``int``): - GIF width as defined by sender. + Animation width as defined by sender. height (``int``): - GIF height as defined by sender. + Animation height as defined by sender. duration (``int``): - Duration of the GIF in seconds as defined by sender. + Duration of the animation in seconds as defined by sender. thumb (:obj:`PhotoSize `, *optional*): - GIF thumbnail. + Animation thumbnail. file_name (``str``, *optional*): - GIF file name. + Animation file name. mime_type (``str``, *optional*): Mime type of a file as defined by sender. @@ -48,7 +48,7 @@ class GIF(Object): File size. date (``int``, *optional*): - Date the GIF was sent in Unix time. + Date the Animation was sent in Unix time. """ ID = 0xb0700025 diff --git a/pyrogram/client/types/message.py b/pyrogram/client/types/message.py index e471c8a5..7b05bfac 100644 --- a/pyrogram/client/types/message.py +++ b/pyrogram/client/types/message.py @@ -92,8 +92,8 @@ class Message(Object): sticker (:obj:`Sticker `, *optional*): Message is a sticker, information about the sticker. - gif (:obj:`Video `, *optional*): - Message is a GIF, information about the GIF. + animation (:obj:`Animation `, *optional*): + Message is an animation, information about the animation. video (:obj:`Video `, *optional*): Message is a video, information about the video. @@ -228,7 +228,7 @@ class Message(Object): game=None, photo=None, sticker=None, - gif=None, + animation=None, video=None, voice=None, video_note=None, @@ -279,7 +279,7 @@ class Message(Object): self.game = game # flags.15?Game self.photo = photo # flags.16?Vector self.sticker = sticker # flags.17?Sticker - self.gif = gif + self.animation = animation self.video = video # flags.18?Video self.voice = voice # flags.19?Voice self.video_note = video_note # flags.20?VideoNote