getGameHighScores()
Use this method to get data for high score tables. Will return the score of the specified user and several of their neighbors in a game. Returns an Array of GameHighScore objects.
This method will currently return scores for the target user, plus two of their closest neighbors on each side. Will also return the top three users if the user and their neighbors are not among them. Please note that this behavior is subject to change.
parameters
| parameter | type | required | description |
|---|---|---|---|
user_id | number | required | Target user id |
chat_id | number | optional | Required if inline_message_id is not specified. Unique identifier for the target chat. |
message_id | number | optional | Required if inline_message_id is not specified. Identifier of the sent message. |
inline_message_id | string | optional | Required if chat_id and message_id are not specified. Identifier of the inline message. |
returns
usage in yaebal
not (yet) hard-typed on Api — call it through the generic .call<T>() escape hatch documented in @yaebal/types.
import type { GameHighScore, GetGameHighScoresParams } from "@yaebal/types";
await bot.api.call<GameHighScore[]>("getGameHighScores", {
user_id: 123456789,
} satisfies GetGameHighScoresParams);context shortcut
also available as ctx.getGameHighScores() on
16
context types — see @yaebal/contexts.
/** Use this method to get data for high score tables. Will return the score of the specified user and several of their neighbors in a game. Returns an Array of [GameHighScore](https://core.telegram.org/bots/api/#gamehighscore) objects. This method will currently return scores for the target user, plus two of their closest neighbors on each side. Will also return the top three users if the user and their neighbors are not among them. Please note that this behavior is subject to change. */
ctx.getGameHighScores(params: Omit<GetGameHighScoresParams, "user_id" | "chat_id" | "message_id">)official Bot API docs: https://core.telegram.org/bots/api/#getgamehighscores