Skip to main content

ronami_core/payloads/
send_rich_message.rs

1//! Generated by `codegen_payloads`, do not edit by hand.
2
3use serde::Serialize;
4
5use crate::types::BusinessConnectionId;
6use crate::types::EffectId;
7use crate::types::EphemeralMessageParameters;
8use crate::types::InputRichMessage;
9use crate::types::Message;
10use crate::types::Recipient;
11use crate::types::ReplyMarkup;
12use crate::types::ReplyParameters;
13use crate::types::SuggestedPostParameters;
14use crate::types::ThreadId;
15use crate::types::TopicId;
16
17impl_payload! {
18    /// Use this method to send rich messages. If the message contains a block with a media element, then the bot must have the right to send the media to the chat. On success, the sent [`Message`] is returned.
19    ///
20    /// [`Message`]: crate::types::Message
21    #[derive(Debug, PartialEq, Clone, Serialize)]
22    pub SendRichMessage (SendRichMessageSetters) => Message {
23        required {
24            /// Unique identifier for the target chat or username of the target channel (in the format `@channelusername`)
25            pub chat_id: Recipient [into],
26            /// The message to be sent
27            pub rich_message: InputRichMessage,
28        }
29        optional {
30            /// Unique identifier of the business connection on behalf of which the message will be sent
31            pub business_connection_id: BusinessConnectionId,
32            /// Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
33            pub message_thread_id: ThreadId,
34            /// Identifier of the direct messages topic to which the message will be sent; required if the message is sent to a direct messages chat
35            pub direct_messages_topic_id: TopicId,
36            /// Sends the message [silently]. Users will receive a notification with no sound.
37            ///
38            /// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
39            pub disable_notification: bool,
40            /// Protects the contents of sent messages from forwarding and saving
41            pub protect_content: bool,
42            /// 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
43            pub allow_paid_broadcast: bool,
44            /// Unique identifier of the message effect to be added to the message; for private chats only
45            pub message_effect_id: EffectId,
46            /// 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.
47            pub suggested_post_parameters: SuggestedPostParameters,
48            /// Description of the message to reply to
49            pub reply_parameters: ReplyParameters,
50            /// 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.
51            ///
52            /// [inline keyboard]: https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating
53            /// [custom reply keyboard]: https://core.telegram.org/bots#keyboards
54            pub reply_markup: ReplyMarkup [into],
55            /// A JSON-serialized object containing the parameters of the ephemeral message to send
56            pub ephemeral_message_parameters: EphemeralMessageParameters,
57        }
58    }
59}