Package dev.inmo.tgbotapi.extensions.utils.types.buttons

Types

Link copied to clipboard
class InlineKeyboardBuilder : MatrixBuilder<InlineKeyboardButton>

Core DSL part of Inline Keyboard DSL. Can accept only InlineKeyboardButton and returns ready to use InlineKeyboardMarkup via build method

Link copied to clipboard
class InlineKeyboardRowBuilder : RowBuilder<InlineKeyboardButton>

Row builder of InlineKeyboardBuilder

Link copied to clipboard
class ReplyKeyboardBuilder : MatrixBuilder<KeyboardButton>

Core DSL part of Keyboard DSL. Can accept only KeyboardButton and returns ready to use ReplyKeyboardMarkup via build method

Link copied to clipboard
class ReplyKeyboardRowBuilder : RowBuilder<KeyboardButton>

Row builder of KeyboardButton

Functions

Link copied to clipboard
inline fun InlineKeyboardRowBuilder.dataButton(text: String, data: String): Boolean
Link copied to clipboard
inline fun InlineKeyboardRowBuilder.gameButton(text: String): Boolean
Link copied to clipboard
inline fun inlineKeyboard(block: InlineKeyboardBuilder.() -> Unit): InlineKeyboardMarkup

Factory-function for InlineKeyboardBuilder. It will apply to internally created InlineKeyboardMarkup and InlineKeyboardBuilder.build then

Link copied to clipboard
fun InlineKeyboardMarkup(vararg buttons: InlineKeyboardButton): InlineKeyboardMarkup
Link copied to clipboard
inline fun InlineKeyboardRowBuilder.inlineQueryButton(text: String, data: String): Boolean
Link copied to clipboard
Link copied to clipboard
inline fun InlineKeyboardRowBuilder.loginButton(text: String, loginUrl: LoginURL): Boolean
Link copied to clipboard
inline fun InlineKeyboardRowBuilder.payButton(text: String): Boolean

Creates and put PayInlineKeyboardButton

Link copied to clipboard
inline fun replyKeyboard(    resizeKeyboard: Boolean? = null,     oneTimeKeyboard: Boolean? = null,     inputFieldPlaceholder: String? = null,     selective: Boolean? = null,     block: ReplyKeyboardBuilder.() -> Unit): ReplyKeyboardMarkup

Factory-function for ReplyKeyboardBuilder. It will apply to internally created ReplyKeyboardMarkup and ReplyKeyboardBuilder.build then

Link copied to clipboard
fun ReplyKeyboardMarkup(    vararg buttons: KeyboardButton,     resizeKeyboard: Boolean? = null,     oneTimeKeyboard: Boolean? = null,     inputFieldPlaceholder: String? = null,     selective: Boolean? = null): ReplyKeyboardMarkup
Link copied to clipboard
inline fun ReplyKeyboardRowBuilder.requestContactButton(text: String): Boolean
Link copied to clipboard
inline fun ReplyKeyboardRowBuilder.requestLocationButton(text: String): Boolean
Link copied to clipboard
inline fun ReplyKeyboardRowBuilder.requestPollButton(text: String, pollType: KeyboardButtonPollType): Boolean
Link copied to clipboard
inline fun InlineKeyboardBuilder.row(block: InlineKeyboardRowBuilder.() -> Unit): Boolean

Creates an InlineKeyboardRowBuilder and apply with this builder

inline fun ReplyKeyboardBuilder.row(block: ReplyKeyboardRowBuilder.() -> Unit): Boolean

Creates an ReplyKeyboardRowBuilder and apply with this builder

Link copied to clipboard
inline fun ReplyKeyboardRowBuilder.simpleButton(text: String): Boolean

Creates and put SimpleKeyboardButton

Link copied to clipboard
inline fun InlineKeyboardRowBuilder.urlButton(text: String, url: String): Boolean

Creates and put URLInlineKeyboardButton

Link copied to clipboard
inline fun InlineKeyboardRowBuilder.webAppButton(text: String, webApp: WebAppInfo): Boolean
inline fun InlineKeyboardRowBuilder.webAppButton(text: String, url: String): Boolean

Creates and put WebAppInlineKeyboardButton. Please, remember that this button is available in private chats only

inline fun ReplyKeyboardRowBuilder.webAppButton(text: String, webApp: WebAppInfo): Boolean
inline fun ReplyKeyboardRowBuilder.webAppButton(text: String, url: String): Boolean

Creates and put WebAppKeyboardButton