Skip to main content
Module

x/grammy/mod.ts>Api#setGameScore

The Telegram Bot Framework.
Extremely Popular
Go to Latest
method Api.prototype.setGameScore
import { Api } from "https://deno.land/x/grammy@v1.11.1/mod.ts";

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

chat_id: number

Unique identifier for the target chat

message_id: number

Identifier of the sent message

user_id: number

User identifier

score: number

New score, must be non-negative

optional
other: Other<R, "setGameScore",
| "chat_id"
| "message_id"
| "inline_message_id"
| "user_id"
| "score"
>

Optional remaining parameters, confer the official reference below

optional
signal: AbortSignal

Optional AbortSignal to cancel the request

Official reference: https://core.telegram.org/bots/api#setgamescore