mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-29 21:48:43 +00:00
add subcondition for adding subparts in raw message entities
This commit is contained in:
parent
72127ce133
commit
b095f07b9c
@ -39,7 +39,7 @@ internal fun RawMessageEntity.asTextParts(source: String, subParts: List<TextPar
|
|||||||
else -> RegularTextSource(sourceSubstring)
|
else -> RegularTextSource(sourceSubstring)
|
||||||
}.let {
|
}.let {
|
||||||
val part = TextPart(range, it)
|
val part = TextPart(range, it)
|
||||||
if (it !is MultilevelTextSource) {
|
if (it !is MultilevelTextSource && subParts.isNotEmpty()) {
|
||||||
(subParts + part).sortedBy { currentPart -> currentPart.range.first }
|
(subParts + part).sortedBy { currentPart -> currentPart.range.first }
|
||||||
} else {
|
} else {
|
||||||
listOf(part)
|
listOf(part)
|
||||||
|
Loading…
Reference in New Issue
Block a user