setGameScore¶
Returns: Message | bool
- class litegram.methods.set_game_score.SetGameScore(*, user_id: int, score: int, force: bool | None = None, disable_edit_message: bool | None = None, chat_id: int | None = None, message_id: int | None = None, inline_message_id: str | None = None, **extra_data: Any)[source]¶
Use this method to set the score of the specified user in a game message. On success, if the message is not an inline message, the
litegram.types.message.Messageis returned, otherwiseTrueis returned. Returns an error, if the new score is not greater than the user’s current score in the chat and force isFalse.Source: https://core.telegram.org/bots/api#setgamescore
- force: bool | None¶
Pass
Trueif the high score is allowed to decrease. This can be useful when fixing mistakes or banning cheaters
- disable_edit_message: bool | None¶
Pass
Trueif the game message should not be automatically edited to include the current scoreboard
- chat_id: int | None¶
Required if inline_message_id is not specified. Unique identifier for the target chat
Usage¶
As bot method¶
result: Message | bool = await bot.set_game_score(...)
Method as object¶
Imports:
from litegram.methods.set_game_score import SetGameScorealias:
from litegram.methods import SetGameScore
With specific bot¶
result: Message | bool = await bot(SetGameScore(...))
As reply into Webhook in handler¶
return SetGameScore(...)