diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/BotCommand.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/BotCommand.kt index 3ac9d3470d..5f280450de 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/BotCommand.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/BotCommand.kt @@ -4,7 +4,10 @@ import com.github.insanusmokrassar.TelegramBotAPI.utils.throwRangeError import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable -val BotCommandNameRegex = Regex("^[a-z_0-9]{${botCommandLengthLimit.first},${botCommandLengthLimit.last}}$") +// Made as lazy for correct work in K/JS +val BotCommandNameRegex by lazy { + Regex("^[a-z_0-9]{${botCommandLengthLimit.first},${botCommandLengthLimit.last}}$") +} @Serializable data class BotCommand( diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt index 915e9bb031..d66576899c 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt @@ -65,11 +65,14 @@ val explanationLimit = 0 .. 200 val openPeriodPollSecondsLimit = 5 .. 600 -val telegramInlineModeGifPermittedMimeTypes = listOf( - BuiltinMimeTypes.Image.Jpg, - BuiltinMimeTypes.Image.Gif, - BuiltinMimeTypes.Video.MP4 -) +// Made as lazy for correct work in K/JS +val telegramInlineModeGifPermittedMimeTypes by lazy { + listOf( + BuiltinMimeTypes.Image.Jpg, + BuiltinMimeTypes.Image.Gif, + BuiltinMimeTypes.Video.MP4 + ) +} const val chatIdField = "chat_id" const val messageIdField = "message_id"