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

Class LivePhoto

src/telegram/_files/livephoto.py:35–119  ·  view source on GitHub ↗

This object represents a live photo. 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. .. versionadded:: 22.8 Args: file_id (:obj:`str`): Identifier for the video file w

Source from the content-addressed store, hash-verified

33
34
35class LivePhoto(_BaseMedium):
36 """
37 This object represents a live photo.
38
39 Objects of this class are comparable in terms of equality. Two objects of this class are
40 considered equal, if their :attr:`file_unique_id` is equal.
41
42 .. versionadded:: 22.8
43
44 Args:
45 file_id (:obj:`str`): Identifier for the video file which can be used to download or reuse
46 the file.
47 file_unique_id (:obj:`str`): Unique identifier for this file, which
48 is supposed to be the same over time and for different bots.
49 Can't be used to download or reuse the file.
50 width (:obj:`int`): Video width as defined by the sender.
51 height (:obj:`int`): Video height as defined by the sender.
52 duration (:obj:`int` | :class:`datetime.timedelta`): Duration of the video
53 in seconds as defined by the sender.
54 photo (Sequence[:obj:`telegram.PhotoSize`], optional): Available sizes of the corresponding
55 static photo.
56 mime_type (:obj:`str`, optional): MIME type of a file as defined by the sender.
57 file_size (:obj:`int`, optional): File size in bytes.
58
59 Attributes:
60 file_id (:obj:`str`): Identifier for the video file which can be used to download or reuse
61 the file.
62 file_unique_id (:obj:`str`): Unique identifier for this file, which
63 is supposed to be the same over time and for different bots.
64 Can't be used to download or reuse the file.
65 width (:obj:`int`): Video width as defined by the sender.
66 height (:obj:`int`): Video height as defined by the sender.
67 duration (:class:`datetime.timedelta`): Duration of the video
68 in seconds as defined by the sender.
69 photo (tuple[:obj:`telegram.PhotoSize`]): Optional. Available sizes of the corresponding
70 static photo.
71 mime_type (:obj:`str`): Optional. MIME type of a file as defined by the sender.
72 file_size (:obj:`int`): Optional. File size in bytes.
73
74 """
75
76 __slots__ = (
77 "duration",
78 "height",
79 "mime_type",
80 "photo",
81 "width",
82 )
83
84 def __init__(
85 self,
86 file_id: str,
87 file_unique_id: str,
88 width: int,
89 height: int,
90 duration: TimePeriod,
91 photo: Sequence[PhotoSize] | None = None,
92 mime_type: str | None = None,

Callers 6

PollMediaTestBaseClass · 0.90
PaidMediaTestBaseClass · 0.90
test_equalityMethod · 0.90
live_photoFunction · 0.90
test_equalityMethod · 0.90

Calls

no outgoing calls

Tested by 3

test_equalityMethod · 0.72
live_photoFunction · 0.72
test_equalityMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…