MCPcopy Index your code
hub / github.com/python-telegram-bot/python-telegram-bot / Animation

Class Animation

src/telegram/_files/animation.py:30–119  ·  view source on GitHub ↗

This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound). Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their :attr:`file_unique_id` is equal. .. versionchanged:: 20.5 |removed_thumb_not

Source from the content-addressed store, hash-verified

28
29
30class Animation(_BaseThumbedMedium):
31 """This object represents an animation file (GIF or H.264/MPEG-4 AVC video without sound).
32
33 Objects of this class are comparable in terms of equality. Two objects of this class are
34 considered equal, if their :attr:`file_unique_id` is equal.
35
36 .. versionchanged:: 20.5
37 |removed_thumb_note|
38
39 Args:
40 file_id (:obj:`str`): Identifier for this file, which can be used to download
41 or reuse the file.
42 file_unique_id (:obj:`str`): Unique identifier for this file, which
43 is supposed to be the same over time and for different bots.
44 Can't be used to download or reuse the file.
45 width (:obj:`int`): Video width as defined by the sender.
46 height (:obj:`int`): Video height as defined by the sender.
47 duration (:obj:`int` | :class:`datetime.timedelta`, optional): Duration of the video
48 in seconds as defined by the sender.
49
50 .. versionchanged:: v22.2
51 |time-period-input|
52 file_name (:obj:`str`, optional): Original animation filename as defined by the sender.
53 mime_type (:obj:`str`, optional): MIME type of the file as defined by the sender.
54 file_size (:obj:`int`, optional): File size in bytes.
55 thumbnail (:class:`telegram.PhotoSize`, optional): Animation thumbnail as defined by
56 sender.
57
58 .. versionadded:: 20.2
59
60 Attributes:
61 file_id (:obj:`str`): Identifier for this file, which can be used to download
62 or reuse the file.
63 file_unique_id (:obj:`str`): Unique identifier for this file, which
64 is supposed to be the same over time and for different bots.
65 Can't be used to download or reuse the file.
66 width (:obj:`int`): Video width as defined by the sender.
67 height (:obj:`int`): Video height as defined by the sender.
68 duration (:obj:`int` | :class:`datetime.timedelta`): Duration of the video in seconds
69 as defined by the sender.
70
71 .. deprecated:: v22.2
72 |time-period-int-deprecated|
73 file_name (:obj:`str`): Optional. Original animation filename as defined by the sender.
74 mime_type (:obj:`str`): Optional. MIME type of the file as defined by the sender.
75 file_size (:obj:`int`): Optional. File size in bytes.
76 thumbnail (:class:`telegram.PhotoSize`): Optional. Animation thumbnail as defined by
77 sender.
78
79 .. versionadded:: 20.2
80
81 """
82
83 __slots__ = ("_duration", "file_name", "height", "mime_type", "width")
84
85 def __init__(
86 self,
87 file_id: str,

Callers 6

PollMediaTestBaseClass · 0.90
PollTestBaseClass · 0.90
test_equalityMethod · 0.90
GameTestBaseClass · 0.90
test_equalityMethod · 0.90

Calls

no outgoing calls

Tested by 3

test_equalityMethod · 0.72
test_equalityMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…