From 9fc80fdd4d01ba9b33b027053309d1d93ce52d54 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Mon, 29 Jun 2026 16:17:56 +0600 Subject: [PATCH] Fix RichTextBotCommand SerialName to bot_command RichTextBotCommand.botCommand reused botCommandField ("command", shared with BotCommand.command) but Bot API docs require "bot_command". Add botCommandFullField = "bot_command" and switch RichTextBotCommand to it. Co-Authored-By: Claude Opus 4.8 --- .../src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt | 1 + .../kotlin/dev/inmo/tgbotapi/types/rich/RichTextEntities.kt | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt index 085a3deb8b..409c65fd8d 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt @@ -463,6 +463,7 @@ const val inputMessageContentField = "input_message_content" const val hideUrlField = "hide_url" const val botCommandField = "command" +const val botCommandFullField = "bot_command" const val botCommandsField = "commands" const val scopeField = "scope" diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextEntities.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextEntities.kt index a54b380dfc..251075be16 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextEntities.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/rich/RichTextEntities.kt @@ -4,7 +4,7 @@ import dev.inmo.tgbotapi.types.CustomEmojiId import dev.inmo.tgbotapi.types.alternativeTextField import dev.inmo.tgbotapi.types.anchorNameField import dev.inmo.tgbotapi.types.bankCardNumberField -import dev.inmo.tgbotapi.types.botCommandField +import dev.inmo.tgbotapi.types.botCommandFullField import dev.inmo.tgbotapi.types.cashtagField import dev.inmo.tgbotapi.types.chat.User import dev.inmo.tgbotapi.types.customEmojiIdField @@ -436,7 +436,7 @@ data class RichTextCashtag( data class RichTextBotCommand( @SerialName(textField) val text: RichText, - @SerialName(botCommandField) + @SerialName(botCommandFullField) val botCommand: String ) : RichTextEntity { @EncodeDefault