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: String, url: String = None, login_url: aiogram.types.login_url.LoginUrl = None, callback_data: String = None, switch_inline_query: String = None, switch_inline_query_current_chat: String = None, callback_game: aiogram.types.callback_game.CallbackGame = None, pay: 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