Struct tgbot::types::SetGameScore
source · pub struct SetGameScore { /* private fields */ }
Expand description
Sets the score of the specified user in a game.
Returns an error, if the new score is not greater
than the user’s current score in the chat and force is false
.
Implementations§
source§impl SetGameScore
impl SetGameScore
sourcepub fn for_chat_message(
chat_id: Integer,
message_id: Integer,
user_id: Integer,
score: Integer
) -> Self
pub fn for_chat_message( chat_id: Integer, message_id: Integer, user_id: Integer, score: Integer ) -> Self
Creates a new SetGameScore
.
§Arguments
chat_id
- Unique identifier of the target chat.message_id
- Identifier of the sent message.user_id
- User identifier.score
- New score, must be non-negative.
sourcepub fn for_inline_message<T>(
inline_message_id: T,
user_id: Integer,
score: Integer
) -> Self
pub fn for_inline_message<T>( inline_message_id: T, user_id: Integer, score: Integer ) -> Self
Creates a new SetGameScore
.
§Arguments
inline_message_id
- Identifier of the inline message.user_id
- User identifier.score
- New score, must be non-negative.
sourcepub fn with_disable_edit_message(self, value: bool) -> Self
pub fn with_disable_edit_message(self, value: bool) -> Self
Sets a new value for a disable_edit_message
flag.
§Arguments
value
- Indicates whether the game message should not be automatically edited to include the current scoreboard.
sourcepub fn with_force(self, value: bool) -> Self
pub fn with_force(self, value: bool) -> Self
Sets a new value for a force
flag.
§Arguments
value
- Indicates whether the high score is allowed to decrease.
This can be useful when fixing mistakes or banning cheaters.
Trait Implementations§
source§impl Clone for SetGameScore
impl Clone for SetGameScore
source§fn clone(&self) -> SetGameScore
fn clone(&self) -> SetGameScore
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for SetGameScore
impl Debug for SetGameScore
source§impl Method for SetGameScore
impl Method for SetGameScore
§type Response = EditMessageResult
type Response = EditMessageResult
The type representing a successful result in an API response.
source§fn into_payload(self) -> Payload
fn into_payload(self) -> Payload
Converts the method into a payload for an HTTP request.
Auto Trait Implementations§
impl Freeze for SetGameScore
impl RefUnwindSafe for SetGameScore
impl Send for SetGameScore
impl Sync for SetGameScore
impl Unpin for SetGameScore
impl UnwindSafe for SetGameScore
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more