mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-12-23 00:57:13 +00:00
RawMessageEntity will not throw exception
This commit is contained in:
parent
482d924070
commit
f68edebd24
@ -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
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user