setGameScore

inline fun setGameScore(userId: Long, messageId: Long, score: Long): SetGameScoreAction

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 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.

Api reference

Parameters

userId

User identifier

score

New score, must be non-negative

force

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

disableEditMessage

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

chatId

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

messageId

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

inlineMessageId

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


inline fun setGameScore(userId: Long, score: Long): SetGameScoreAction
inline fun setGameScore(user: User, score: Long): SetGameScoreAction
inline fun setGameScore(user: User, messageId: Long, score: Long): SetGameScoreAction