set_game_score

template<class Agent>
api_result<variant_t<message_t, boolean_t>, Agent&&> set_game_score(Agent &&agent, set_game_score_args_t args)
template<class Agent, class F>
void set_game_score(Agent &&agent, set_game_score_args_t args, F &&callback)

agent is any object satisfying agent concept.

callback is any callable object accepting expected<variant_t<message_t, boolean_t>>.

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.

struct set_game_score_args_t

Arguments that should be passed to set_game_score().

integer_t user_id

User identifier

integer_t score

New score, must be non-negative

optional_t<boolean_t> force

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

optional_t<boolean_t> disable_edit_message

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

optional_t<integer_t> chat_id

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

optional_t<integer_t> message_id

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

optional_t<string_t> inline_message_id

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