Returns: Union[Message, bool]

class aiogram.methods.set_game_score.SetGameScore(*, user_id: int, score: int, force: Optional[bool] = None, disable_edit_message: Optional[bool] = None, chat_id: Optional[int] = None, message_id: Optional[int] = None, inline_message_id: Optional[str] = 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 aiogram.types.message.Message is returned, otherwise True is returned. Returns an error, if the new score is not greater than the user’s current score in the chat and force is False.


user_id: int#

User identifier

score: int#

New score, must be non-negative

force: Optional[bool]#

Pass True if the high score is allowed to decrease. This can be useful when fixing mistakes or banning cheaters

disable_edit_message: Optional[bool]#

Pass True if the game message should not be automatically edited to include the current scoreboard

chat_id: Optional[int]#

Required if inline_message_id is not specified. Unique identifier for the target chat

message_id: Optional[int]#

Required if inline_message_id is not specified. Identifier of the sent message

inline_message_id: Optional[str]#

Required if chat_id and message_id are not specified. Identifier of the inline message

build_request(bot: Bot) Request[source]#


As bot method#

result: Union[Message, bool] = await bot.set_game_score(...)

Method as object#


  • from aiogram.methods.set_game_score import SetGameScore

  • alias: from aiogram.methods import SetGameScore

With specific bot#

result: Union[Message, bool] = await bot(SetGameScore(...))

As reply into Webhook in handler#

return SetGameScore(...)