ReplyKeyboardMarkup

class aiogram.types.reply_keyboard.ReplyKeyboardMarkup(keyboard: Optional[List[List[aiogram.types.reply_keyboard.KeyboardButton]]] = None, resize_keyboard: Boolean = None, one_time_keyboard: Boolean = None, selective: Boolean = None, row_width: Integer = 3)[source]

Bases: aiogram.types.base.TelegramObject

This object represents a custom keyboard with reply options (see Introduction to bots for details and examples).

https://core.telegram.org/bots/api#replykeyboardmarkup

add(*args)[source]

Add buttons

Parameters

args

Returns

self

Return type

types.ReplyKeyboardMarkup

row(*args)[source]

Add row

Parameters

args

Returns

self

Return type

types.ReplyKeyboardMarkup

insert(button)[source]

Insert button to last row

Parameters

button

Returns

self

Return type

types.ReplyKeyboardMarkup

KeyboardButton

class aiogram.types.reply_keyboard.KeyboardButton(text: String, request_contact: Boolean = None, request_location: Boolean = None)[source]

Bases: aiogram.types.base.TelegramObject

This object represents one button of the reply keyboard. For simple text buttons String can be used instead of this object to specify text of the button. Optional fields are mutually exclusive. Note: request_contact and request_location options will only work in Telegram versions released after 9 April, 2016. Older clients will ignore them.

https://core.telegram.org/bots/api#keyboardbutton

ReplyKeyboardRemove

class aiogram.types.reply_keyboard.ReplyKeyboardRemove(selective: Boolean = None)[source]

Bases: aiogram.types.base.TelegramObject

Upon receiving a message with this object, Telegram clients will remove the current custom keyboard and display the default letter-keyboard. By default, custom keyboards are displayed until a new keyboard is sent by a bot. An exception is made for one-time keyboards that are hidden immediately after the user presses a button (see ReplyKeyboardMarkup).

https://core.telegram.org/bots/api#replykeyboardremove