Module telegram-bot-lua.methods.games

games API methods.

Functions

api.get_game_high_scores(user_id, opts) get high score data for a game.
api.send_game(chat_id, game_short_name, opts) send a game to a chat.
api.set_game_score(user_id, score, opts) set the score of the specified user in a game.


Functions

api.get_game_high_scores(user_id, opts)
get high score data for a game.

Parameters:

  • user_id number identifier of the target user
  • opts table optional parameters (chatid, messageid, inlinemessageid)

Returns:

  1. table|false array of GameHighScore objects, or false on failure
  2. string|table the HTTP status or error details
api.send_game(chat_id, game_short_name, opts)
send a game to a chat.

Parameters:

  • chat_id number unique identifier for the target chat
  • game_short_name string short name of the game
  • opts table optional parameters (messagethreadid, disablenotification, protectcontent, replyparameters, replymarkup, etc.)

Returns:

  1. table|false the sent message, or false on failure
  2. string|table the HTTP status or error details
api.set_game_score(user_id, score, opts)
set the score of the specified user in a game.

Parameters:

  • user_id number identifier of the target user
  • score number new score, must be non-negative
  • opts table optional parameters (force, disableeditmessage, chatid, messageid, inlinemessageid)

Returns:

  1. table|false the edited message or true on success, or false on failure
  2. string|table the HTTP status or error details
generated by LDoc 1.5.0 Last updated 2026-04-07 21:37:15