Skip to main content

ronami_core/payloads/
send_message.rs

1//! Generated by `codegen_payloads`, do not edit by hand.
2
3use serde::Serialize;
4
5use crate::types::{
6    BusinessConnectionId, CallbackQueryId, EffectId, LinkPreviewOptions, Message, MessageEntity,
7    ParseMode, Recipient, ReplyMarkup, ReplyParameters, SuggestedPostParameters, ThreadId, TopicId,
8    UserId,
9};
10
11impl_payload! {
12    /// Use this method to send text messages. On success, the sent [`Message`] is returned.
13    ///
14    /// [`Message`]: crate::types::Message
15    #[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize)]
16    pub SendMessage (SendMessageSetters) => Message {
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            /// Text of the message to be sent, 1-4096 characters after entities parsing
21            pub text: String [into],
22        }
23        optional {
24            /// Unique identifier of the business connection on behalf of which the message will be sent
25            pub business_connection_id: BusinessConnectionId,
26            /// Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
27            pub message_thread_id: ThreadId,
28            /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
29            pub direct_messages_topic_id: TopicId,
30            /// Mode for parsing entities in the message text. See [formatting options] for more details.
31            ///
32            /// [formatting options]: https://core.telegram.org/bots/api#formatting-options
33            pub parse_mode: ParseMode,
34            /// List of special entities that appear in the message text, which can be specified instead of _parse\_mode_
35            pub entities: Vec<MessageEntity> [collect],
36            /// Link preview generation options for the message
37            pub link_preview_options: LinkPreviewOptions,
38            /// Sends the message [silently]. Users will receive a notification with no sound.
39            ///
40            /// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
41            pub disable_notification: bool,
42            /// Protects the contents of sent messages from forwarding and saving
43            pub protect_content: bool,
44            /// Pass `true` to allow up to 1000 messages per second, ignoring broadcasting limits for a fee of 0.1 Telegram Stars per message. The relevant Stars will be withdrawn from the bot's balance
45            pub allow_paid_broadcast: bool,
46            /// Unique identifier of the message effect to be added to the message; for private chats only
47            pub message_effect_id: EffectId,
48            /// An object containing the parameters of the suggested post to send; for direct messages chats only. If the message is sent as a reply to another suggested post, then that suggested post is automatically declined.
49            pub suggested_post_parameters: SuggestedPostParameters,
50            /// Identifier of the user who received the message
51            pub receiver_user_id: UserId,
52            /// Unique identifier of the query to be answered
53            pub callback_query_id: CallbackQueryId,
54            /// Description of the message to reply to
55            pub reply_parameters: ReplyParameters,
56            /// Additional interface options. A JSON-serialized object for an [inline keyboard], [custom reply keyboard], instructions to remove a reply keyboard or to force a reply from the user. Not supported for messages sent on behalf of a business account.
57            ///
58            /// [inline keyboard]: https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating
59            /// [custom reply keyboard]: https://core.telegram.org/bots#keyboards
60            pub reply_markup: ReplyMarkup [into],
61        }
62    }
63}