mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-29 21:48:43 +00:00
fixes
This commit is contained in:
parent
0914710cc7
commit
eb923a6338
@ -162,9 +162,9 @@ internal fun TextSource.toRawMessageEntities(offset: Int = 0): List<RawMessageEn
|
|||||||
|
|
||||||
internal fun List<TextSource>.toRawMessageEntities(preOffset: Int = 0): List<RawMessageEntity> {
|
internal fun List<TextSource>.toRawMessageEntities(preOffset: Int = 0): List<RawMessageEntity> {
|
||||||
var i = preOffset
|
var i = preOffset
|
||||||
return flatMap {
|
return flatMap { textSource ->
|
||||||
it.toRawMessageEntities(i).also {
|
textSource.toRawMessageEntities(i).also {
|
||||||
i += it.maxByOrNull { it.length }!!.length + 1
|
i += it.maxByOrNull { it.length } ?.length ?: textSource.source.length
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user