Skip to main content

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

NameTypeRequiredDescription
EditMessageboolSet this flag if the game message should be automatically edited to include the current scoreboard
ForceboolSet this flag if the high score is allowed to decrease. This can be useful when fixing mistakes or banning cheaters
IDInputBotInlineMessageIDClassyesID of the inline message
UserIDInputUserClassyesUser identifier
ScoreintyesNew score

Returns

bool

Possible errors

CodeTypeDescription
400MESSAGE_ID_INVALIDThe provided message id is invalid.
400USER_BOT_REQUIREDThis method can only be called by a bot.

References