diff --git a/CHANGELOG.md b/CHANGELOG.md index 8dac4d4575..43da309d6c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,8 @@ * All `MessageEntity` classes now have no income parameter `sourceString` * In most part of `TextSource` classes `asMarkdownSource` and `asHtmlSource` now are getters instead if fields * All parseMode-specific functions in `StringFormatting` now are not `infix` +* Now will not be thrown exception when there is income unknown type of `MessageEntity`. Instead of this will be +created `RegularTextMessageEntity` with the same text * Removed constructor of `TextMentionMessageEntity`, which was deprecated previously * Removed constructor of `TextMentionTextSource`, which was deprecated previously * All `TelegramMediaFile` instances now have field `fileUniqueId`, which represents `file_unique_id` field from API diff --git a/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/MessageEntity/RawMessageEntity.kt b/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/MessageEntity/RawMessageEntity.kt index b732fcb1dc..1d5ceac9a7 100644 --- a/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/MessageEntity/RawMessageEntity.kt +++ b/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/MessageEntity/RawMessageEntity.kt @@ -32,7 +32,7 @@ internal data class RawMessageEntity( "text_mention" -> TextMentionMessageEntity(offset, length, sourceSubstring, user ?: throw IllegalStateException("User must not be null for text mention")) "underline" -> UnderlineMessageEntity(offset, length, sourceSubstring) "strikethrough" -> StrikethroughMessageEntity(offset, length, sourceSubstring) - else -> throw IllegalArgumentException("Unknown type of message entity") + else -> RegularTextMessageEntity(offset, length, sourceSubstring) } } }