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

Method send_video_note

src/telegram/_bot.py:2304–2461  ·  view source on GitHub ↗

As of v.4.0, Telegram clients support rounded square mp4 videos of up to 1 minute long. Use this method to send video messages. Note: :paramref:`thumbnail` will be ignored for small video files, for which Telegram can easily generate thumbnails. Howe

(
        self,
        chat_id: int | str,
        video_note: "FileInput | VideoNote",
        duration: TimePeriod | None = None,
        length: int | None = None,
        disable_notification: ODVInput[bool] = DEFAULT_NONE,
        reply_markup: "ReplyMarkup | None" = None,
        protect_content: ODVInput[bool] = DEFAULT_NONE,
        message_thread_id: int | None = None,
        thumbnail: "FileInput | None" = None,
        reply_parameters: "ReplyParameters | None" = None,
        business_connection_id: str | None = None,
        message_effect_id: str | None = None,
        allow_paid_broadcast: bool | None = None,
        direct_messages_topic_id: int | None = None,
        suggested_post_parameters: "SuggestedPostParameters | None" = None,
        *,
        allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
        reply_to_message_id: int | None = None,
        filename: str | 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

2302 )
2303
2304 async def send_video_note(
2305 self,
2306 chat_id: int | str,
2307 video_note: "FileInput | VideoNote",
2308 duration: TimePeriod | None = None,
2309 length: int | None = None,
2310 disable_notification: ODVInput[bool] = DEFAULT_NONE,
2311 reply_markup: "ReplyMarkup | None" = None,
2312 protect_content: ODVInput[bool] = DEFAULT_NONE,
2313 message_thread_id: int | None = None,
2314 thumbnail: "FileInput | None" = None,
2315 reply_parameters: "ReplyParameters | None" = None,
2316 business_connection_id: str | None = None,
2317 message_effect_id: str | None = None,
2318 allow_paid_broadcast: bool | None = None,
2319 direct_messages_topic_id: int | None = None,
2320 suggested_post_parameters: "SuggestedPostParameters | None" = None,
2321 *,
2322 allow_sending_without_reply: ODVInput[bool] = DEFAULT_NONE,
2323 reply_to_message_id: int | None = None,
2324 filename: str | None = None,
2325 read_timeout: ODVInput[float] = DEFAULT_NONE,
2326 write_timeout: ODVInput[float] = DEFAULT_NONE,
2327 connect_timeout: ODVInput[float] = DEFAULT_NONE,
2328 pool_timeout: ODVInput[float] = DEFAULT_NONE,
2329 api_kwargs: JSONDict | None = None,
2330 ) -> Message:
2331 """
2332 As of v.4.0, Telegram clients support rounded square mp4 videos of up to 1 minute long.
2333 Use this method to send video messages.
2334
2335 Note:
2336 :paramref:`thumbnail` will be ignored for small video files, for which Telegram can
2337 easily generate thumbnails. However, this behaviour is undocumented and might be
2338 changed by Telegram.
2339
2340 .. seealso:: :wiki:`Working with Files and Media <Working-with-Files-and-Media>`
2341
2342 .. versionchanged:: 20.5
2343 |removed_thumb_arg|
2344
2345 Args:
2346 chat_id (:obj:`int` | :obj:`str`): |chat_id_channel|
2347 video_note (:obj:`str` | :term:`file object` | :class:`~telegram.InputFile` | \
2348 :obj:`bytes` | :class:`pathlib.Path` | :class:`telegram.VideoNote`): Video note
2349 to send.
2350 Pass a file_id as String to send a video note that exists on the Telegram
2351 servers (recommended) or upload a new video using multipart/form-data.
2352 |uploadinput|
2353 Lastly you can pass an existing :class:`telegram.VideoNote` object to send.
2354 Sending video notes by a URL is currently unsupported.
2355
2356 .. versionchanged:: 13.2
2357 Accept :obj:`bytes` as input.
2358
2359 .. versionchanged:: 20.0
2360 File paths as input is also accepted for bots *not* running in
2361 :paramref:`~telegram.Bot.local_mode`.

Calls 2

_parse_file_inputMethod · 0.95
_send_messageMethod · 0.95