Games

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

parametertyperequireddescription
user_idnumberrequiredTarget user id
chat_idnumberoptionalRequired if inline_message_id is not specified. Unique identifier for the target chat.
message_idnumberoptionalRequired if inline_message_id is not specified. Identifier of the sent message.
inline_message_idstringoptionalRequired if chat_id and message_id are not specified. Identifier of the inline message.

returns

GameHighScore[]

usage in yaebal

not (yet) hard-typed on Api — call it through the generic .call<T>() escape hatch documented in @yaebal/types.

bot.ts
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.

context shortcut
/** 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">)