version: 2.1.3







setGameScore

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.

Parameters

user_id int User identifier Optional
score int New score, must be non-negative Yes
force bool Pass True, if the high score is allowed to decrease. This can be useful when fixing mistakes or banning cheaters Optional
disable_edit_message bool Pass True, if the game message should not be automatically edited to include the current scoreboard Optional
chat_id int Required if inline_message_id is not specified. Unique identifier for the target chat Optional
message_id int Required if inline_message_id is not specified. Identifier of the sent message Optional
inline_message_id string Required if chat_id and message_id are not specified. Identifier of the inline message Optional
token String You can use this method on another bot with specify this parameter Optional
return_array Boolean Specify the result type , if pass true results will be array otherwise will be object Optional
forgot Boolean You can set to not receive request result, dont set it or pass null for turn it off Optional
answer Boolean You can set to answer to webhook, dont set it or pass null for turn it off Optional

Method errors

ErrorNamedescription
required parameters not found required parameter for this method is not founded. you can see them in log
answer mode not allowed you can use answer mode only once for each webhook update and you already did
answer mode not allowed bc multi you can't use answer mode when multi is on

Method examples

$this->setGameScore(['user_id' => int, 'score' => int, 'force' => bool, 'disable_edit_message' => bool, 'chat_id' => int, 'message_id' => int, 'inline_message_id' => string]);
$this->setGameScore(['score' => int]);

Method alices

Method output :

Message | bool