1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2026-03-03 09:22:22 +00:00

add support of iconCustomEmojiId in BottomButton

This commit is contained in:
2026-03-02 16:56:57 +06:00
parent b533bab95f
commit 8eb8e5ee1f

View File

@@ -1,10 +1,13 @@
package dev.inmo.tgbotapi.webapps
import dev.inmo.tgbotapi.types.CustomEmojiId
import kotlin.js.Json
import kotlin.js.json
external class BottomButton {
val text: String
val iconCustomEmojiId: CustomEmojiId?
fun setText(text: String): BottomButton
var color: String
@@ -32,6 +35,7 @@ external class BottomButton {
}
data class BottomButtonParams(
val iconCustomEmojiId: CustomEmojiId? = null,
val text: String? = null,
val color: String? = null,
val textColor: String? = null,
@@ -42,6 +46,7 @@ data class BottomButtonParams(
fun BottomButton.setParams(params: BottomButtonParams) = setParams(
json(
*listOfNotNull(
params.iconCustomEmojiId ?.let { "icon_custom_emoji_id" to params.iconCustomEmojiId },
params.text ?.let { "text" to params.text },
params.color ?.let { "color" to params.color },
params.textColor ?.let { "text_color" to params.textColor },