InlineQueryResultAudio¶
- class telegram.InlineQueryResultAudio(id, audio_url, title, performer=None, audio_duration=None, caption=None, reply_markup=None, input_message_content=None, parse_mode=None, caption_entities=None, *, api_kwargs=None)[source]¶
Bases:
telegram.InlineQueryResultRepresents a link to an mp3 audio file. By default, this audio file will be sent by the user. Alternatively, you can use
input_message_contentto send a message with the specified content instead of the audio.See also
Use In
- Parameters:
audio_duration (
int|datetime.timedelta, optional) –Audio duration in seconds.
Changed in version v22.2:
datetime.timedeltaobjects are accepted in addition to plainintvalues.caption (
str, optional) – Caption, 0-1024characters after entities parsing.parse_mode (
str, optional) – Mode for parsing entities. Seetelegram.constants.ParseModeand formatting options for more details.caption_entities (Sequence[
telegram.MessageEntity], optional) –Sequence of special entities that appear in the caption, which can be specified instead of
parse_mode.Changed in version 20.0: Accepts any
collections.abc.Sequenceas input instead of just a list. The input is converted to a tuple.reply_markup (
telegram.InlineKeyboardMarkup, optional) – Inline keyboard attached to the message.input_message_content (
telegram.InputMessageContent, optional) – Content of the message to be sent instead of the audio.
- audio_duration[source]¶
Optional. Audio duration in seconds.
Deprecated since version v22.2: In a future major version this attribute will be of type
datetime.timedelta. You can opt-in early by setting PTB_TIMEDELTA=true orPTB_TIMEDELTA=1as an environment variable.- Type:
- parse_mode[source]¶
Optional. Mode for parsing entities. See
telegram.constants.ParseModeand formatting options for more details.- Type:
- caption_entities[source]¶
Optional. Tuple of special entities that appear in the caption, which can be specified instead of
parse_mode.Changed in version 20.0:
This attribute is now an immutable tuple.
This attribute is now always a tuple, that may be empty.
- Type:
tuple[
telegram.MessageEntity]