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

Method reply_voice

src/telegram/_message.py:3321–3402  ·  view source on GitHub ↗

Shortcut for:: await bot.send_voice( update.effective_message.chat_id, message_thread_id=update.effective_message.message_thread_id, business_connection_id=self.business_connection_id, direct_messages_topic_id=self.dir

(
        self,
        voice: "FileInput | Voice",
        duration: TimePeriod | None = None,
        caption: str | None = None,
        disable_notification: ODVInput[bool] = DEFAULT_NONE,
        reply_markup: "ReplyMarkup | None" = None,
        parse_mode: ODVInput[str] = DEFAULT_NONE,
        caption_entities: Sequence["MessageEntity"] | None = None,
        protect_content: ODVInput[bool] = DEFAULT_NONE,
        message_thread_id: ODVInput[int] = DEFAULT_NONE,
        reply_parameters: "ReplyParameters | None" = None,
        message_effect_id: str | None = None,
        allow_paid_broadcast: bool | None = None,
        suggested_post_parameters: "SuggestedPostParameters | None" = None,
        *,
        reply_to_message_id: int | None = None,
        allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
        filename: str | None = None,
        do_quote: bool | (_ReplyKwargs | None) = None,
        read_timeout: ODVInput[float] = DEFAULT_NONE,
        write_timeout: ODVInput[float] = DEFAULT_NONE,
        connect_timeout: ODVInput[float] = DEFAULT_NONE,
        pool_timeout: ODVInput[float] = DEFAULT_NONE,
        api_kwargs: JSONDict | None = None,
    )

Source from the content-addressed store, hash-verified

3319 )
3320
3321 async def reply_voice(
3322 self,
3323 voice: "FileInput | Voice",
3324 duration: TimePeriod | None = None,
3325 caption: str | None = None,
3326 disable_notification: ODVInput[bool] = DEFAULT_NONE,
3327 reply_markup: "ReplyMarkup | None" = None,
3328 parse_mode: ODVInput[str] = DEFAULT_NONE,
3329 caption_entities: Sequence["MessageEntity"] | None = None,
3330 protect_content: ODVInput[bool] = DEFAULT_NONE,
3331 message_thread_id: ODVInput[int] = DEFAULT_NONE,
3332 reply_parameters: "ReplyParameters | None" = None,
3333 message_effect_id: str | None = None,
3334 allow_paid_broadcast: bool | None = None,
3335 suggested_post_parameters: "SuggestedPostParameters | None" = None,
3336 *,
3337 reply_to_message_id: int | None = None,
3338 allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
3339 filename: str | None = None,
3340 do_quote: bool | (_ReplyKwargs | None) = None,
3341 read_timeout: ODVInput[float] = DEFAULT_NONE,
3342 write_timeout: ODVInput[float] = DEFAULT_NONE,
3343 connect_timeout: ODVInput[float] = DEFAULT_NONE,
3344 pool_timeout: ODVInput[float] = DEFAULT_NONE,
3345 api_kwargs: JSONDict | None = None,
3346 ) -> "Message":
3347 """Shortcut for::
3348
3349 await bot.send_voice(
3350 update.effective_message.chat_id,
3351 message_thread_id=update.effective_message.message_thread_id,
3352 business_connection_id=self.business_connection_id,
3353 direct_messages_topic_id=self.direct_messages_topic.topic_id,
3354 *args,
3355 **kwargs,
3356 )
3357
3358 For the documentation of the arguments, please see :meth:`telegram.Bot.send_voice`.
3359
3360 .. versionchanged:: 21.1
3361 |reply_same_thread|
3362
3363 .. versionchanged:: 22.0
3364 |quote_removed|
3365
3366 Keyword Args:
3367 do_quote (:obj:`bool` | :obj:`dict`, optional): |do_quote|
3368
3369 .. versionadded:: 20.8
3370
3371 Returns:
3372 :class:`telegram.Message`: On success, instance representing the message posted.
3373
3374 """
3375 chat_id, effective_reply_parameters = await self._parse_quote_arguments(
3376 do_quote, reply_to_message_id, reply_parameters, allow_sending_without_reply
3377 )
3378 message_thread_id = self._parse_message_thread_id(chat_id, message_thread_id)

Callers 1

test_reply_voiceMethod · 0.80

Calls 5

get_botMethod · 0.80
send_voiceMethod · 0.45

Tested by 1

test_reply_voiceMethod · 0.64