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

Types

InlineKeyboardBuilder
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

InlineKeyboardRowBuilder
Link copied to clipboard
class InlineKeyboardRowBuilder : RowBuilder<InlineKeyboardButton>

Row builder of InlineKeyboardBuilder

ReplyKeyboardBuilder
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

ReplyKeyboardRowBuilder
Link copied to clipboard
class ReplyKeyboardRowBuilder : RowBuilder<KeyboardButton>

Row builder of KeyboardButton

Functions

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

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

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

Creates and put PayInlineKeyboardButton

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

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

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

Creates an InlineKeyboardRowBuilder and apply with this builder

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

Creates an ReplyKeyboardRowBuilder and apply with this builder

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

Creates and put SimpleKeyboardButton

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

Creates and put URLInlineKeyboardButton