Classes

Markup

Methods

(inner) buildKeyboard(buttons, optionsopt) → {Array.<Array.<InlineKeyboardButton>>|Array.<Array.<KeyboardButton>>}

Keyboard build method used by Markup.inlineKeyboard / Markup.keyboard

Parameters:
NameTypeAttributesDescription
buttonsArray.<InlineKeyboardButton> | Array.<Array.<InlineKeyboardButton>> | Array.<KeyboardButton> | Array.<Array.<KeyboardButton>>
optionsKeyboardOptions | InlineKeyboardOptions<optional>
Returns:
Type: 
Array.<Array.<InlineKeyboardButton>> | Array.<Array.<KeyboardButton>>

Type Definitions

BotRequestButton

Type:
  • object
Properties
NameTypeDescription
textstring

Text of the button.

request_userBotRequestButtonParams

Button params object

BotRequestButtonParams

Type:
  • object
Properties
NameTypeAttributesDescription
request_idnumber

Signed 32-bit identifier of the request, which will be received back in the UserShared object. Must be unique within the message

user_is_botboolean<optional>

Optional. Pass True to request a bot, pass False to request a regular user. If not specified, no additional restrictions are applied.

ChannelRequestButton

Type:
  • object
Properties
NameTypeDescription
textstring

Text of the button.

request_chatGroupRequestButtonParams

Button params object

ChannelRequestButtonExtra

Type:
  • object
Properties
NameTypeAttributesDescription
chat_has_usernameboolean<optional>

Optional. Pass True to request a supergroup or a channel with a username, pass False to request a chat without a username. If not specified, no additional restrictions are applied.

chat_is_createdboolean<optional>

Optional. Pass True to request a channel owned by the user. Otherwise, no additional restrictions are applied.

user_administrator_rightsChatAdministratorRights<optional>

Optional. A JSON-serialized object listing the required administrator rights of the user in the chat. The rights must be a superset of bot_administrator_rights. If not specified, no additional restrictions are applied.

bot_administrator_rightsChatAdministratorRights<optional>

Optional. A JSON-serialized object listing the required administrator rights of the bot in the chat. The rights must be a subset of user_administrator_rights. If not specified, no additional restrictions are applied.

bot_is_memberboolean<optional>

Optional. Pass True to request a chat with the bot as a member. Otherwise, no additional restrictions are applied.

ChannelRequestButtonParams

Type:
  • object
Properties
NameTypeAttributesDefaultDescription
request_idnumber

Signed 32-bit identifier of the request, which will be received back in the ChatShared object. Must be unique within the message

chat_is_channelboolean<optional>
true

Select channel True

chat_has_usernameboolean<optional>

Optional. True for request a supergroup or a channel with a username, False for request a chat without a username.

chat_is_createdboolean<optional>

Optional. True for request a channel owned by the user.

user_administrator_rightsChatAdministratorRights<optional>

Optional. A JSON-serialized object listing the required administrator rights of the user in the chat. The rights must be a superset of bot_administrator_rights.

bot_administrator_rightsChatAdministratorRights<optional>

Optional. A JSON-serialized object listing the required administrator rights of the bot in the chat. The rights must be a subset of user_administrator_rights.

bot_is_memberboolean<optional>

Optional. Pass True to request a chat with the bot as a member.

EscapeFunction(text) → {string}

Parameters:
NameTypeDescription
textstring
Returns:
Type: 
string

GroupRequestButton

Type:
  • object
Properties
NameTypeDescription
textstring

Text of the button.

request_chatGroupRequestButtonParams

Button params object

GroupRequestButtonExtra

Type:
  • object
Properties
NameTypeAttributesDescription
chat_is_forumboolean<optional>

Optional. Pass True to request a forum supergroup, pass False to request a non-forum chat. If not specified, no additional restrictions are applied.

chat_has_usernameboolean<optional>

Optional. Pass True to request a supergroup or a channel with a username, pass False to request a chat without a username. If not specified, no additional restrictions are applied.

chat_is_createdboolean<optional>

Optional. Pass True to request a chat owned by the user. Otherwise, no additional restrictions are applied.

user_administrator_rightsChatAdministratorRights<optional>

Optional. A JSON-serialized object listing the required administrator rights of the user in the chat. The rights must be a superset of bot_administrator_rights. If not specified, no additional restrictions are applied.

bot_administrator_rightsChatAdministratorRights<optional>

Optional. A JSON-serialized object listing the required administrator rights of the bot in the chat. The rights must be a subset of user_administrator_rights. If not specified, no additional restrictions are applied.

bot_is_memberboolean<optional>

Optional. Pass True to request a chat with the bot as a member. Otherwise, no additional restrictions are applied.

GroupRequestButtonParams

Type:
  • object
Properties
NameTypeAttributesDefaultDescription
request_idnumber

Signed 32-bit identifier of the request, which will be received back in the ChatShared object. Must be unique within the message

chat_is_channelboolean<optional>
false

Select group True

chat_is_forumboolean<optional>

Optional. True to request a forum supergroup, False to request an offline chat.

chat_has_usernameboolean<optional>

Optional. True for request a supergroup or a channel with a username, False for request a chat without a username.

chat_is_createdboolean<optional>

Optional. True for request a chat owned by the user.

user_administrator_rightsChatAdministratorRights<optional>

Optional. A JSON-serialized object listing the required administrator rights of the user in the chat. The rights must be a superset of bot_administrator_rights.

bot_administrator_rightsChatAdministratorRights<optional>

Optional. A JSON-serialized object listing the required administrator rights of the bot in the chat. The rights must be a subset of user_administrator_rights.

bot_is_memberboolean<optional>

Optional. Pass True to request a chat with the bot as a member.

SwitchInlineQueryChosenChatAllowList

This object represents an inline button that switches the current user to inline mode in a chosen chat, with an optional default inline query.

Type:
  • object
Properties
NameTypeAttributesDescription
allow_user_chatsboolean<optional>

Optional. True, if private chats with users can be chosen

allow_bot_chatsboolean<optional>

Optional. True, if private chats with bots can be chosen

allow_group_chatsboolean<optional>

Optional. True, if group and supergroup chats can be chosen

allow_channel_chatsboolean<optional>

Optional. True, if channel chats can be chosen

TagEscapeFunction(template, …substitutions) → {string}

Parameters:
NameTypeAttributesDescription
templateTemplateStringsArray
substitutionsstring<repeatable>
Returns:
Type: 
string

UserRequestButton

Type:
  • object
Properties
NameTypeDescription
textstring

Text of the button.

request_userUserRequestButtonParams

Button params object

UserRequestButtonParams

Type:
  • object
Properties
NameTypeAttributesDescription
request_idnumber

Signed 32-bit identifier of the request, which will be received back in the UserShared object. Must be unique within the message

user_is_premiumboolean<optional>

Optional. Pass True to request a bot, pass False to request a regular user. If not specified, no additional restrictions are applied.