mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-22 16:23:48 +00:00
flatInlineKeyboard and flatReplyKeyboard
This commit is contained in:
parent
3d7334dd62
commit
3f9237b5de
@ -9,6 +9,7 @@
|
|||||||
* `Utils`:
|
* `Utils`:
|
||||||
* New extension `Message#sameChat`
|
* New extension `Message#sameChat`
|
||||||
* New extension `Message#sameMessage`
|
* New extension `Message#sameMessage`
|
||||||
|
* New functions `flatInlineKeyboard` and `flatReplyKeyboard`
|
||||||
|
|
||||||
## 2.1.3
|
## 2.1.3
|
||||||
|
|
||||||
|
@ -40,6 +40,16 @@ inline fun inlineKeyboard(
|
|||||||
block: InlineKeyboardBuilder.() -> Unit
|
block: InlineKeyboardBuilder.() -> Unit
|
||||||
) = InlineKeyboardBuilder().apply(block).build()
|
) = InlineKeyboardBuilder().apply(block).build()
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Factory-function for [InlineKeyboardBuilder], but in difference with [inlineKeyboard] this function will create single-row
|
||||||
|
* inline keyboard
|
||||||
|
*
|
||||||
|
* @see InlineKeyboardBuilder.row
|
||||||
|
*/
|
||||||
|
inline fun flatInlineKeyboard(
|
||||||
|
block: InlineKeyboardRowBuilder.() -> Unit
|
||||||
|
) = inlineKeyboard { row(block) }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an [InlineKeyboardRowBuilder] and [apply] [block] with this builder
|
* Creates an [InlineKeyboardRowBuilder] and [apply] [block] with this builder
|
||||||
*
|
*
|
||||||
|
@ -47,6 +47,20 @@ inline fun replyKeyboard(
|
|||||||
block: ReplyKeyboardBuilder.() -> Unit
|
block: ReplyKeyboardBuilder.() -> Unit
|
||||||
) = ReplyKeyboardBuilder().apply(block).build(resizeKeyboard, oneTimeKeyboard, inputFieldPlaceholder, selective)
|
) = ReplyKeyboardBuilder().apply(block).build(resizeKeyboard, oneTimeKeyboard, inputFieldPlaceholder, selective)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Factory-function for [ReplyKeyboardBuilder], but in difference with [replyKeyboard] this method will create single-row
|
||||||
|
* keyboard
|
||||||
|
*/
|
||||||
|
inline fun flatReplyKeyboard(
|
||||||
|
resizeKeyboard: Boolean? = null,
|
||||||
|
oneTimeKeyboard: Boolean? = null,
|
||||||
|
inputFieldPlaceholder: String? = null,
|
||||||
|
selective: Boolean? = null,
|
||||||
|
block: ReplyKeyboardRowBuilder.() -> Unit
|
||||||
|
) = replyKeyboard(resizeKeyboard, oneTimeKeyboard, inputFieldPlaceholder, selective) {
|
||||||
|
row(block)
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an [ReplyKeyboardRowBuilder] and [apply] [block] with this builder
|
* Creates an [ReplyKeyboardRowBuilder] and [apply] [block] with this builder
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user