Airgram

Guides
/
/
Methods

api.setGameScore()

Updates the game score of the specified user in the game; for bots only

Parameters SetGameScoreParams:

NameTypeDescription
chatIdnumber The chat to which the message with the game belongs
messageIdnumber Identifier of the message
editMessageboolean True, if the message needs to be edited
userIdnumber User identifier
scorenumber The new score
forceboolean Pass true to update the score even if it decreases. If the score is 0, the user will be deleted from the high score table
Returns ApiResponse interface:
interface ApiResponse {
  _: 'setGameScore' | 'error'
  airgram: Airgram
  request: {
    method: 'setGameScore'
    params: SetGameScoreParams
  }
  response:  | 
  setState: (nextState: Record<string, unknown>) => void
  getState: () => Record<string, unknown>
}