From 59d7a7c78126b4ea0015d6b4d7dc0e27c16dcfa3 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Wed, 5 May 2021 19:02:22 +0600 Subject: [PATCH] fix in text sources list creating --- CHANGELOG.md | 3 +++ .../dev/inmo/tgbotapi/types/MessageEntity/RawMessageEntity.kt | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 04557fef4e..0215dfaec7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## 0.34.1 +* `Core` + * Fix in creating of text sources list + ## 0.34.0 **UPDATE UP TO Telegram Bot API 5.2** diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/RawMessageEntity.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/RawMessageEntity.kt index 4234bdd191..c294fcbafb 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/RawMessageEntity.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/MessageEntity/RawMessageEntity.kt @@ -59,7 +59,7 @@ internal fun List.fillWithRegulars(source: String): List val textSource = get(i) val thisSourceInStart = source.startsWith(textSource.source, index) if (!thisSourceInStart) { - val regularEndIndex = source.indexOf(textSource.source) + val regularEndIndex = source.indexOf(textSource.source, index) result.add(regular(source.substring(index, regularEndIndex))) index = regularEndIndex }