mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-22 08:13:47 +00:00
commit
0510f72859
@ -1,5 +1,11 @@
|
||||
# TelegramBotAPI changelog
|
||||
|
||||
## 0.38.22
|
||||
|
||||
* `Core`:
|
||||
* New constant `tgWebAppStartParamField`
|
||||
* All keyboards builders and rows blocks becomes not crossinline
|
||||
|
||||
## 0.38.21
|
||||
|
||||
* `WebApps`:
|
||||
|
@ -20,6 +20,6 @@ javax_activation_version=1.1.1
|
||||
dokka_version=1.6.10
|
||||
|
||||
library_group=dev.inmo
|
||||
library_version=0.38.21
|
||||
library_version=0.38.22
|
||||
|
||||
github_release_plugin_version=2.3.7
|
||||
|
@ -96,6 +96,8 @@ val telegramInlineModeGifPermittedMimeTypes by lazy {
|
||||
)
|
||||
}
|
||||
|
||||
const val tgWebAppStartParamField = "tgWebAppStartParam"
|
||||
|
||||
const val chatIdField = "chat_id"
|
||||
const val senderChatIdField = "sender_chat_id"
|
||||
const val messageIdField = "message_id"
|
||||
|
@ -0,0 +1,5 @@
|
||||
package dev.inmo.tgbotapi.utils.extensions
|
||||
|
||||
import dev.inmo.tgbotapi.types.tgWebAppStartParamField
|
||||
|
||||
fun createWebAppStartParam(value: String) = tgWebAppStartParamField to value
|
@ -37,7 +37,7 @@ class InlineKeyboardRowBuilder : RowBuilder<InlineKeyboardButton>()
|
||||
* @see InlineKeyboardBuilder.row
|
||||
*/
|
||||
inline fun inlineKeyboard(
|
||||
crossinline block: InlineKeyboardBuilder.() -> Unit
|
||||
block: InlineKeyboardBuilder.() -> Unit
|
||||
) = InlineKeyboardBuilder().apply(block).build()
|
||||
|
||||
/**
|
||||
@ -52,7 +52,7 @@ inline fun inlineKeyboard(
|
||||
* @see urlButton
|
||||
*/
|
||||
inline fun InlineKeyboardBuilder.row(
|
||||
crossinline block: InlineKeyboardRowBuilder.() -> Unit
|
||||
block: InlineKeyboardRowBuilder.() -> Unit
|
||||
) = add(InlineKeyboardRowBuilder().apply(block).row)
|
||||
|
||||
/**
|
||||
|
@ -44,7 +44,7 @@ inline fun replyKeyboard(
|
||||
oneTimeKeyboard: Boolean? = null,
|
||||
inputFieldPlaceholder: String? = null,
|
||||
selective: Boolean? = null,
|
||||
crossinline block: ReplyKeyboardBuilder.() -> Unit
|
||||
block: ReplyKeyboardBuilder.() -> Unit
|
||||
) = ReplyKeyboardBuilder().apply(block).build(resizeKeyboard, oneTimeKeyboard, inputFieldPlaceholder, selective)
|
||||
|
||||
/**
|
||||
@ -56,7 +56,7 @@ inline fun replyKeyboard(
|
||||
* @see requestPollButton
|
||||
*/
|
||||
inline fun ReplyKeyboardBuilder.row(
|
||||
crossinline block: ReplyKeyboardRowBuilder.() -> Unit
|
||||
block: ReplyKeyboardRowBuilder.() -> Unit
|
||||
) = add(ReplyKeyboardRowBuilder().apply(block).row)
|
||||
|
||||
/**
|
||||
@ -110,3 +110,14 @@ inline fun ReplyKeyboardRowBuilder.webAppButton(
|
||||
text: String,
|
||||
webApp: WebAppInfo
|
||||
) = add(WebAppKeyboardButton(text, webApp))
|
||||
|
||||
/**
|
||||
* Creates and put [WebAppKeyboardButton]
|
||||
*
|
||||
* @see replyKeyboard
|
||||
* @see ReplyKeyboardBuilder.row
|
||||
*/
|
||||
inline fun ReplyKeyboardRowBuilder.webAppButton(
|
||||
text: String,
|
||||
url: String
|
||||
) = webAppButton(text, WebAppInfo(url))
|
||||
|
Loading…
Reference in New Issue
Block a user