InlineKeyboardMarkup

class aiogram.types.inline_keyboard.InlineKeyboardMarkup(row_width=3, inline_keyboard=None, **kwargs)[source]

Bases: aiogram.types.base.TelegramObject

This object represents an inline keyboard that appears right next to the message it belongs to.

Note: This will only work in Telegram versions released after 9 April, 2016. Older clients will display unsupported message.

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

Deserialize object

Parameters
  • conf

  • kwargs

add(*args)[source]

Add buttons

Parameters

args

Returns

self

Return type

types.InlineKeyboardMarkup

row(*args)[source]

Add row

Parameters

args

Returns

self

Return type

types.InlineKeyboardMarkup

insert(button)[source]

Insert button to last row

Parameters

button

Returns

self

Return type

types.InlineKeyboardMarkup

InlineKeyboardButton

class aiogram.types.inline_keyboard.InlineKeyboardButton(text: aiogram.types.base.String, url: Optional[aiogram.types.base.String] = None, login_url: Optional[aiogram.types.login_url.LoginUrl] = None, callback_data: Optional[aiogram.types.base.String] = None, switch_inline_query: Optional[aiogram.types.base.String] = None, switch_inline_query_current_chat: Optional[aiogram.types.base.String] = None, callback_game: Optional[aiogram.types.callback_game.CallbackGame] = None, pay: Optional[aiogram.types.base.Boolean] = None, **kwargs)[source]

Bases: aiogram.types.base.TelegramObject

This object represents one button of an inline keyboard. You must use exactly one of the optional fields.

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

Deserialize object

Parameters
  • conf

  • kwargs