teloxide_core/payloads/
send_chat_action.rs

1//! Generated by `codegen_payloads`, do not edit by hand.
2
3use serde::Serialize;
4
5use crate::types::{BusinessConnectionId, ChatAction, Recipient, ThreadId, True};
6
7impl_payload! {
8    /// Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns True on success.
9    ///
10    /// > Example: The [ImageBot] needs some time to process a request and upload the image. Instead of sending a text message along the lines of “Retrieving image, please wait…”, the bot may use sendChatAction with action = upload_photo. The user will see a “sending photo” status for the bot.
11    ///
12    /// We only recommend using this method when a response from the bot will take a **noticeable** amount of time to arrive.
13    ///
14    /// [ImageBot]: https://t.me/imagebot
15    #[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize)]
16    pub SendChatAction (SendChatActionSetters) => True {
17        required {
18            /// Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
19            pub chat_id: Recipient [into],
20            /// Type of action to broadcast. Choose one, depending on what the user is about to receive: typing for [text messages], upload_photo for [photos], record_video or upload_video for [videos], record_audio or upload_audio for [audio files], upload_document for [general files], choose_sticker for [stickers], find_location for [location data], record_video_note or upload_video_note for [video notes].
21            ///
22            /// [text messages]: crate::payloads::SendMessage
23            /// [photos]: crate::payloads::SendPhoto
24            /// [videos]: crate::payloads::SendVideo
25            /// [audio files]: crate::payloads::SendAudio
26            /// [general files]: crate::payloads::SendDocument
27            /// [stickers]: crate::payloads::SendSticker
28            /// [location data]: crate::payloads::SendLocation
29            /// [video notes]: crate::payloads::SendVideoNote
30            pub action: ChatAction,
31        }
32        optional {
33            /// Unique identifier of the business connection on behalf of which the action will be sent
34            pub business_connection_id: BusinessConnectionId,
35            /// Unique identifier for the target message thread; supergroups only
36            pub message_thread_id: ThreadId,
37        }
38    }
39}