teloxide_core/payloads/
send_game.rs

1//! Generated by `codegen_payloads`, do not edit by hand.
2
3use serde::Serialize;
4
5use crate::types::{
6    BusinessConnectionId, ChatId, EffectId, Message, ReplyMarkup, ReplyParameters, ThreadId,
7};
8
9impl_payload! {
10    /// Use this method to send a game. On success, the sent [`Message`] is returned.
11    ///
12    /// [`Message`]: crate::types::Message
13    #[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize)]
14    pub SendGame (SendGameSetters) => Message {
15        required {
16            /// Unique identifier for the target chat
17            pub chat_id: ChatId [into],
18            /// Short name of the game, serves as the unique identifier for the game. Set up your games via Botfather.
19            pub game_short_name: String [into],
20        }
21        optional {
22            /// Unique identifier of the business connection on behalf of which the message will be sent
23            pub business_connection_id: BusinessConnectionId,
24            /// Unique identifier for the target message thread (topic) of the forum; for forum supergroups only
25            pub message_thread_id: ThreadId,
26            /// Sends the message [silently]. Users will receive a notification with no sound.
27            ///
28            /// [silently]: https://telegram.org/blog/channels-2-0#silent-messages
29            pub disable_notification: bool,
30            /// Protects the contents of sent messages from forwarding and saving
31            pub protect_content: bool,
32            /// 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
33            pub allow_paid_broadcast: bool,
34            /// Unique identifier of the message effect to be added to the message; for private chats only
35            pub message_effect_id: EffectId,
36            /// Description of the message to reply to
37            pub reply_parameters: ReplyParameters,
38            /// A JSON-serialized object for an [inline keyboard]. If empty, one 'Play game_title' button will be shown. If not empty, the first button must launch the game. Not supported for messages sent on behalf of a business account.
39            ///
40            /// [inline keyboard]: https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating
41            pub reply_markup: ReplyMarkup [into],
42        }
43    }
44}