Module telegram-bot-lua.methods.bot

bot API methods.

Functions

api.delete_my_commands(opts) delete the list of the bot's commands for the given scope and language.
api.get_chat_menu_button(opts) get the current value of the bot's menu button in a private chat or the default menu button.
api.get_file(file_id) get basic info about a file and prepare it for downloading.
api.get_managed_bot_token(user_id) get the token of a managed bot.
api.get_my_commands(opts) get the current list of the bot's commands for the given scope and language.
api.get_my_default_administrator_rights(opts) get the current default administrator rights of the bot.
api.get_my_description(opts) get the current bot description for the given language.
api.get_my_name(opts) get the current bot name for the given language.
api.get_my_short_description(opts) get the current bot short description for the given language.
api.remove_my_profile_photo(opts) remove the bot's profile photo.
api.replace_managed_bot_token(user_id) replace the token of a managed bot with a new one.
api.save_prepared_keyboard_button(user_id, button) save a prepared keyboard button for later use.
api.set_chat_menu_button(opts) change the bot's menu button in a private chat or the default menu button.
api.set_my_commands(commands, opts) change the list of the bot's commands.
api.set_my_default_administrator_rights(opts) change the default administrator rights requested by the bot when it's added to groups or channels.
api.set_my_description(description, opts) change the bot's description.
api.set_my_name(name, opts) change the bot's name.
api.set_my_profile_photo(opts) set the bot's profile photo.
api.set_my_short_description(short_description, opts) change the bot's short description.


Functions

api.delete_my_commands(opts)
delete the list of the bot's commands for the given scope and language.

Parameters:

  • opts table optional parameters
    • scope table|string a JSON-serialized scope of users for which commands are relevant
    • language_code string a two-letter ISO 639-1 language code

Returns:

    table,number the response object and HTTP status
api.get_chat_menu_button(opts)
get the current value of the bot's menu button in a private chat or the default menu button.

Parameters:

  • opts table optional parameters
    • chat_id number|string unique identifier for the target private chat

Returns:

    table,number the response object and HTTP status
api.get_file(file_id)
get basic info about a file and prepare it for downloading.

Parameters:

  • file_id string file identifier to get info about

Returns:

    table,number the response object and HTTP status
api.get_managed_bot_token(user_id)
get the token of a managed bot.

Parameters:

  • user_id number unique identifier of the managed bot user

Returns:

    table,number the response object and HTTP status
api.get_my_commands(opts)
get the current list of the bot's commands for the given scope and language.

Parameters:

  • opts table optional parameters
    • scope table|string a JSON-serialized scope of users for which commands are relevant
    • language_code string a two-letter ISO 639-1 language code

Returns:

    table,number the response object and HTTP status
api.get_my_default_administrator_rights(opts)
get the current default administrator rights of the bot.

Parameters:

  • opts table optional parameters
    • for_channels boolean pass true to get the default rights for channels

Returns:

    table,number the response object and HTTP status
api.get_my_description(opts)
get the current bot description for the given language.

Parameters:

  • opts table optional parameters
    • language_code string a two-letter ISO 639-1 language code

Returns:

    table,number the response object and HTTP status
api.get_my_name(opts)
get the current bot name for the given language.

Parameters:

  • opts table optional parameters
    • language_code string a two-letter ISO 639-1 language code

Returns:

    table,number the response object and HTTP status
api.get_my_short_description(opts)
get the current bot short description for the given language.

Parameters:

  • opts table optional parameters
    • language_code string a two-letter ISO 639-1 language code

Returns:

    table,number the response object and HTTP status
api.remove_my_profile_photo(opts)
remove the bot's profile photo.

Parameters:

  • opts table optional parameters
    • is_public boolean pass true to remove the public photo

Returns:

    table,number the response object and HTTP status
api.replace_managed_bot_token(user_id)
replace the token of a managed bot with a new one.

Parameters:

  • user_id number unique identifier of the managed bot user

Returns:

    table,number the response object and HTTP status
api.save_prepared_keyboard_button(user_id, button)
save a prepared keyboard button for later use.

Parameters:

  • user_id number unique identifier of the target user
  • button table|string a JSON-serialized keyboard button to save

Returns:

    table,number the response object and HTTP status
api.set_chat_menu_button(opts)
change the bot's menu button in a private chat or the default menu button.

Parameters:

  • opts table optional parameters
    • chat_id number|string unique identifier for the target private chat
    • menu_button table|string a JSON-serialized object for the bot's new menu button

Returns:

    table,number the response object and HTTP status
api.set_my_commands(commands, opts)
change the list of the bot's commands.

Parameters:

  • commands table|string a JSON-serialized or encoded list of BotCommand
  • opts table optional parameters
    • scope table|string a JSON-serialized scope of users for which commands are relevant
    • language_code string a two-letter ISO 639-1 language code

Returns:

    table,number the response object and HTTP status
api.set_my_default_administrator_rights(opts)
change the default administrator rights requested by the bot when it's added to groups or channels.

Parameters:

  • opts table optional parameters
    • rights table|string a JSON-serialized object describing new default administrator rights
    • for_channels boolean pass true to change the default rights for channels

Returns:

    table,number the response object and HTTP status
api.set_my_description(description, opts)
change the bot's description. truncated to 512 characters.

Parameters:

  • description string new bot description (max 512 characters)
  • opts table optional parameters
    • language_code string a two-letter ISO 639-1 language code

Returns:

    table,number the response object and HTTP status
api.set_my_name(name, opts)
change the bot's name. truncated to 64 characters.

Parameters:

  • name string new bot name (max 64 characters)
  • opts table optional parameters
    • language_code string a two-letter ISO 639-1 language code

Returns:

    table,number the response object and HTTP status
api.set_my_profile_photo(opts)
set the bot's profile photo.

Parameters:

  • opts table optional parameters
    • photo string the photo to set as the bot's profile photo (file upload)
    • is_public boolean pass true to set the public photo

Returns:

    table,number the response object and HTTP status
api.set_my_short_description(short_description, opts)
change the bot's short description. truncated to 120 characters.

Parameters:

  • short_description string new short description (max 120 characters)
  • opts table optional parameters
    • language_code string a two-letter ISO 639-1 language code

Returns:

    table,number the response object and HTTP status
generated by LDoc 1.5.0 Last updated 2026-04-07 21:37:15