messages.setInlineGameScore
Use this method to set the score of the specified user in a game sent as an inline message (bots only).
func (c *Client) MessagesSetInlineGameScore(ctx context.Context, request *MessagesSetInlineGameScoreRequest) (bool, error)
Calling this method
client.Run(ctx, func(ctx context.Context) error {
api := client.API()
res, err := api.MessagesSetInlineGameScore(ctx, &tg.MessagesSetInlineGameScoreRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // bool
return nil
})
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
EditMessage | bool | — | Set this flag if the game message should be automatically edited to include the current scoreboard |
Force | bool | — | Set this flag if the high score is allowed to decrease. This can be useful when fixing mistakes or banning cheaters |
ID | InputBotInlineMessageIDClass | yes | ID of the inline message |
UserID | InputUserClass | yes | User identifier |
Score | int | yes | New score |
Returns
bool
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | MESSAGE_ID_INVALID | The provided message id is invalid. |
| 400 | USER_BOT_REQUIRED | This method can only be called by a bot. |
References
- Official documentation
- Generated Go reference
- TL definition:
messages.setInlineGameScore#15ad9f64