teloxide_core/payloads/
set_game_score.rs

1//! Generated by `codegen_payloads`, do not edit by hand.
2
3use serde::Serialize;
4
5use crate::types::{Message, MessageId, UserId};
6
7impl_payload! {
8    /// Use this method to set the score of the specified user in a game. On success, returns the edited [`Message`]. Returns an error, if the new score is not greater than the user's current score in the chat and force is False.
9    ///
10    /// See also: [`SetGameScoreInline`](crate::payloads::SetGameScoreInline)
11    ///
12    /// [`Message`]: crate::types::Message
13    #[derive(Debug, PartialEq, Eq, Hash, Clone, Serialize)]
14    pub SetGameScore (SetGameScoreSetters) => Message {
15        required {
16            /// User identifier
17            pub user_id: UserId,
18            /// New score
19            pub score: u64,
20            /// Unique identifier for the target chat
21            pub chat_id: u32,
22            /// Identifier of the message to edit
23            #[serde(flatten)]
24            pub message_id: MessageId,
25        }
26        optional {
27            /// Pass True, if the high score is allowed to decrease. This can be useful when fixing mistakes or banning cheaters
28            pub force: bool,
29            /// Pass True, if the game message should not be automatically edited to include the current scoreboard
30            pub disable_edit_message: bool,
31        }
32    }
33}