2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-28 21:07:59 +00:00

Rename GIF to Animation

This commit is contained in:
Dan 2018-08-06 21:38:44 +02:00
parent 6cc87d50c9
commit b1c12c3232
7 changed files with 19 additions and 19 deletions

View File

@ -30,7 +30,7 @@ from .client.types import (
Audio, Chat, ChatMember, ChatMembers, ChatPhoto, Contact, Document, InputMediaPhoto, Audio, Chat, ChatMember, ChatMembers, ChatPhoto, Contact, Document, InputMediaPhoto,
InputMediaVideo, InputMediaDocument, InputMediaAudio, InputMediaAnimation, InputPhoneContact, InputMediaVideo, InputMediaDocument, InputMediaAudio, InputMediaAnimation, InputPhoneContact,
Location, Message, MessageEntity, Dialog, Dialogs, Photo, PhotoSize, Sticker, Update, User, 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 InlineKeyboardButton, InlineKeyboardMarkup, KeyboardButton, ReplyKeyboardMarkup, ReplyKeyboardRemove
) )
from .client import ( from .client import (

View File

@ -293,7 +293,7 @@ def parse_messages(
venue = None venue = None
audio = None audio = None
voice = None voice = None
gif = None animation = None
video = None video = None
video_note = None video_note = None
sticker = None sticker = None
@ -432,7 +432,7 @@ def parse_messages(
elif types.DocumentAttributeAnimated in attributes: elif types.DocumentAttributeAnimated in attributes:
video_attributes = attributes.get(types.DocumentAttributeVideo, None) video_attributes = attributes.get(types.DocumentAttributeVideo, None)
gif = pyrogram_types.GIF( animation = pyrogram_types.Animation(
file_id=encode( file_id=encode(
pack( pack(
"<iiqq", "<iiqq",
@ -584,7 +584,7 @@ def parse_messages(
venue=venue, venue=venue,
audio=audio, audio=audio,
voice=voice, voice=voice,
gif=gif, animation=animation,
video=video, video=video,
video_note=video_note, video_note=video_note,
sticker=sticker, sticker=sticker,

View File

@ -111,7 +111,7 @@ class DownloadMedia(BaseClient):
pyrogram_types.Voice, pyrogram_types.Voice,
pyrogram_types.VideoNote, pyrogram_types.VideoNote,
pyrogram_types.Sticker, pyrogram_types.Sticker,
pyrogram_types.GIF pyrogram_types.Animation
)): )):
if isinstance(message, pyrogram_types.Photo): if isinstance(message, pyrogram_types.Photo):
media = pyrogram_types.Document( media = pyrogram_types.Document(

View File

@ -31,7 +31,7 @@ from .input_media_photo import InputMediaPhoto
from .input_media_video import InputMediaVideo from .input_media_video import InputMediaVideo
from .input_phone_contact import InputPhoneContact from .input_phone_contact import InputPhoneContact
from .media import ( from .media import (
Audio, Contact, Document, GIF, Location, Photo, PhotoSize, Audio, Contact, Document, Animation, Location, Photo, PhotoSize,
Sticker, Venue, Video, VideoNote, Voice, UserProfilePhotos Sticker, Venue, Video, VideoNote, Voice, UserProfilePhotos
) )
from .message import Message from .message import Message

View File

@ -16,10 +16,10 @@
# You should have received a copy of the GNU Lesser General Public License # You should have received a copy of the GNU Lesser General Public License
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>. # along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
from .animation import Animation
from .audio import Audio from .audio import Audio
from .contact import Contact from .contact import Contact
from .document import Document from .document import Document
from .gif import GIF
from .location import Location from .location import Location
from .photo import Photo from .photo import Photo
from .photo_size import PhotoSize from .photo_size import PhotoSize

View File

@ -19,27 +19,27 @@
from pyrogram.api.core import Object from pyrogram.api.core import Object
class GIF(Object): class Animation(Object):
"""This object represents a GIF file. """This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound).
Args: Args:
file_id (``str``): file_id (``str``):
Unique identifier for this file. Unique identifier for this file.
width (``int``): width (``int``):
GIF width as defined by sender. Animation width as defined by sender.
height (``int``): height (``int``):
GIF height as defined by sender. Animation height as defined by sender.
duration (``int``): 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 <pyrogram.PhotoSize>`, *optional*): thumb (:obj:`PhotoSize <pyrogram.PhotoSize>`, *optional*):
GIF thumbnail. Animation thumbnail.
file_name (``str``, *optional*): file_name (``str``, *optional*):
GIF file name. Animation file name.
mime_type (``str``, *optional*): mime_type (``str``, *optional*):
Mime type of a file as defined by sender. Mime type of a file as defined by sender.
@ -48,7 +48,7 @@ class GIF(Object):
File size. File size.
date (``int``, *optional*): date (``int``, *optional*):
Date the GIF was sent in Unix time. Date the Animation was sent in Unix time.
""" """
ID = 0xb0700025 ID = 0xb0700025

View File

@ -92,8 +92,8 @@ class Message(Object):
sticker (:obj:`Sticker <pyrogram.Sticker>`, *optional*): sticker (:obj:`Sticker <pyrogram.Sticker>`, *optional*):
Message is a sticker, information about the sticker. Message is a sticker, information about the sticker.
gif (:obj:`Video <pyrogram.Video>`, *optional*): animation (:obj:`Animation <pyrogram.Animation>`, *optional*):
Message is a GIF, information about the GIF. Message is an animation, information about the animation.
video (:obj:`Video <pyrogram.Video>`, *optional*): video (:obj:`Video <pyrogram.Video>`, *optional*):
Message is a video, information about the video. Message is a video, information about the video.
@ -228,7 +228,7 @@ class Message(Object):
game=None, game=None,
photo=None, photo=None,
sticker=None, sticker=None,
gif=None, animation=None,
video=None, video=None,
voice=None, voice=None,
video_note=None, video_note=None,
@ -279,7 +279,7 @@ class Message(Object):
self.game = game # flags.15?Game self.game = game # flags.15?Game
self.photo = photo # flags.16?Vector<PhotoSize> self.photo = photo # flags.16?Vector<PhotoSize>
self.sticker = sticker # flags.17?Sticker self.sticker = sticker # flags.17?Sticker
self.gif = gif self.animation = animation
self.video = video # flags.18?Video self.video = video # flags.18?Video
self.voice = voice # flags.19?Voice self.voice = voice # flags.19?Voice
self.video_note = video_note # flags.20?VideoNote self.video_note = video_note # flags.20?VideoNote