mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-28 04:48:06 +00:00
Rename GIF to Animation
This commit is contained in:
parent
6cc87d50c9
commit
b1c12c3232
@ -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 (
|
||||
|
@ -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(
|
||||
"<iiqq",
|
||||
@ -584,7 +584,7 @@ def parse_messages(
|
||||
venue=venue,
|
||||
audio=audio,
|
||||
voice=voice,
|
||||
gif=gif,
|
||||
animation=animation,
|
||||
video=video,
|
||||
video_note=video_note,
|
||||
sticker=sticker,
|
||||
|
@ -111,7 +111,7 @@ class DownloadMedia(BaseClient):
|
||||
pyrogram_types.Voice,
|
||||
pyrogram_types.VideoNote,
|
||||
pyrogram_types.Sticker,
|
||||
pyrogram_types.GIF
|
||||
pyrogram_types.Animation
|
||||
)):
|
||||
if isinstance(message, pyrogram_types.Photo):
|
||||
media = pyrogram_types.Document(
|
||||
|
@ -31,7 +31,7 @@ from .input_media_photo import InputMediaPhoto
|
||||
from .input_media_video import InputMediaVideo
|
||||
from .input_phone_contact import InputPhoneContact
|
||||
from .media import (
|
||||
Audio, Contact, Document, GIF, Location, Photo, PhotoSize,
|
||||
Audio, Contact, Document, Animation, Location, Photo, PhotoSize,
|
||||
Sticker, Venue, Video, VideoNote, Voice, UserProfilePhotos
|
||||
)
|
||||
from .message import Message
|
||||
|
@ -16,10 +16,10 @@
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with Pyrogram. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
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
|
||||
|
@ -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 <pyrogram.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
|
@ -92,8 +92,8 @@ class Message(Object):
|
||||
sticker (:obj:`Sticker <pyrogram.Sticker>`, *optional*):
|
||||
Message is a sticker, information about the sticker.
|
||||
|
||||
gif (:obj:`Video <pyrogram.Video>`, *optional*):
|
||||
Message is a GIF, information about the GIF.
|
||||
animation (:obj:`Animation <pyrogram.Animation>`, *optional*):
|
||||
Message is an animation, information about the animation.
|
||||
|
||||
video (:obj:`Video <pyrogram.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<PhotoSize>
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user