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

Types

Link copied to clipboard
typealias 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
typealias InlineKeyboardRowBuilder = RowBuilder<InlineKeyboardButton>

Row builder of InlineKeyboardBuilder

Link copied to clipboard
typealias 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
typealias ReplyKeyboardRowBuilder = RowBuilder<KeyboardButton>

Row builder of KeyboardButton

Functions

Link copied to clipboard
fun InlineKeyboardBuilder.build(): InlineKeyboardMarkup
fun ReplyKeyboardBuilder.build(    resizeKeyboard: Boolean? = null,     oneTimeKeyboard: Boolean? = null,     inputFieldPlaceholder: String? = null,     selective: Boolean? = null): ReplyKeyboardMarkup

Creates InlineKeyboardMarkup using internal matrix

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

Factory-function for InlineKeyboardBuilder, but in difference with inlineKeyboard this function will create single-row inline keyboard

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

Factory-function for ReplyKeyboardBuilder, but in difference with replyKeyboard this method will create single-row keyboard

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 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