Skip to main content
This section covers how to create and send interactive keyboards using the native Bot API classes available in the BLP environment.

Inline Keyboards

Inline keyboards appear attached to the message itself and can trigger callbacks or open URLs.

Sending an Inline Keyboard

To send an inline keyboard, you need to construct a two-dimensional array of InlineKeyboardButton objects and wrap it in an InlineKeyboardMarkup.
BLP Example

Answering Callback Queries (answerCallbackQuery)

When a user clicks an inline button containing callback_data, your bot will receive a callback_query update. You must answer this query using answerCallbackQuery to stop the loading icon on the user’s button.
BLP Example

Reply Keyboards (Custom Keyboards)

Reply keyboards replace the user’s default keyboard with custom buttons. These buttons send plain text messages when tapped.

Sending a Reply Keyboard

Use KeyboardButton and ReplyKeyboardMarkup.
BLP Example

Removing a Reply Keyboard

To remove a custom reply keyboard and restore the user’s default typing keyboard, use ReplyKeyboardRemove.
BLP Example