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

Class Audio

src/telegram/_files/audio.py:30–121  ·  view source on GitHub ↗

This object represents an audio file to be treated as music by the Telegram clients. 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_note|

Source from the content-addressed store, hash-verified

28
29
30class Audio(_BaseThumbedMedium):
31 """This object represents an audio file to be treated as music by the Telegram clients.
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
40 Args:
41 file_id (:obj:`str`): Identifier for this file, which can be used to download
42 or reuse the file.
43 file_unique_id (:obj:`str`): Unique identifier for this file, which is supposed to be
44 the same over time and for different bots. Can't be used to download or reuse the file.
45 duration (:obj:`int` | :class:`datetime.timedelta`): Duration of the audio in
46 seconds as defined by the sender.
47
48 .. versionchanged:: v22.2
49 |time-period-input|
50 performer (:obj:`str`, optional): Performer of the audio as defined by the sender or by
51 audio tags.
52 title (:obj:`str`, optional): Title of the audio as defined by the sender or by audio tags.
53 file_name (:obj:`str`, optional): Original filename as defined by the sender.
54 mime_type (:obj:`str`, optional): MIME type of the file as defined by the sender.
55 file_size (:obj:`int`, optional): File size in bytes.
56 thumbnail (:class:`telegram.PhotoSize`, optional): Thumbnail of the album cover to
57 which the music file belongs.
58
59 .. versionadded:: 20.2
60
61 Attributes:
62 file_id (:obj:`str`): Identifier for this file, which can be used to download
63 or reuse the file.
64 file_unique_id (:obj:`str`): Unique identifier for this file, which is supposed to be
65 the same over time and for different bots. Can't be used to download or reuse the file.
66 duration (:obj:`int` | :class:`datetime.timedelta`): Duration of the audio in seconds as
67 defined by the sender.
68
69 .. deprecated:: v22.2
70 |time-period-int-deprecated|
71 performer (:obj:`str`): Optional. Performer of the audio as defined by the sender or by
72 audio tags.
73 title (:obj:`str`): Optional. Title of the audio as defined by the sender or by audio tags.
74 file_name (:obj:`str`): Optional. Original filename as defined by the sender.
75 mime_type (:obj:`str`): Optional. MIME type of the file as defined by the sender.
76 file_size (:obj:`int`): Optional. File size in bytes.
77 thumbnail (:class:`telegram.PhotoSize`): Optional. Thumbnail of the album cover to
78 which the music file belongs.
79
80 .. versionadded:: 20.2
81
82
83 """
84
85 __slots__ = ("_duration", "file_name", "mime_type", "performer", "title")
86
87 def __init__(

Callers 9

PollMediaTestBaseClass · 0.90
test_equalityMethod · 0.90
test_equalityMethod · 0.90
test_equalityMethod · 0.90
test_equalityMethod · 0.90
test_equalityMethod · 0.90
test_equalityMethod · 0.90

Calls

no outgoing calls

Tested by 6

test_equalityMethod · 0.72
test_equalityMethod · 0.72
test_equalityMethod · 0.72
test_equalityMethod · 0.72
test_equalityMethod · 0.72
test_equalityMethod · 0.72

Used in the wild real call sites across dependent graphs

searching dependent graphs…