From 48c4a3156b2b915fb8107e678a0dd3c1d7a5f52c Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 4 Aug 2022 18:15:51 +0600 Subject: [PATCH] fix of build --- .../utils/internal/MultilevelTextSourceFormatting.kt | 7 +++---- .../dev/inmo/tgbotapi/utils/internal/StringFormatting.kt | 5 ++--- .../extensions/utils/formatting/LinksFormatting.kt | 2 +- .../extensions/utils/formatting/StringFormatting.kt | 6 +++--- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/internal/MultilevelTextSourceFormatting.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/internal/MultilevelTextSourceFormatting.kt index 56ffef940a..54338b3a7a 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/internal/MultilevelTextSourceFormatting.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/internal/MultilevelTextSourceFormatting.kt @@ -1,8 +1,7 @@ package dev.inmo.tgbotapi.utils.internal +import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.message.textsources.MultilevelTextSource -import dev.inmo.tgbotapi.types.UserId -import dev.inmo.tgbotapi.types.link import dev.inmo.tgbotapi.utils.extensions.* internal fun MultilevelTextSource.markdownV2Default( @@ -61,8 +60,8 @@ internal fun MultilevelTextSource.underlineMarkdownV2(): String = markdownV2Defa internal fun MultilevelTextSource.underlineHTML(): String = htmlDefault(htmlUnderlineControl) -internal fun MultilevelTextSource.textMentionMarkdownV2(userId: UserId): String = linkMarkdownV2(userId.link) -internal fun MultilevelTextSource.textMentionHTML(userId: UserId): String = linkHTML(userId.link) +internal fun MultilevelTextSource.textMentionMarkdownV2(userId: UserId): String = linkMarkdownV2(userId.userLink) +internal fun MultilevelTextSource.textMentionHTML(userId: UserId): String = linkHTML(userId.userLink) internal fun MultilevelTextSource.mentionMarkdownV2(): String = optionalPrefix("@") + subsources.makeMarkdownV2String() internal fun MultilevelTextSource.mentionHTML(): String = optionalPrefix("@") + subsources.makeHtmlString() diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/internal/StringFormatting.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/internal/StringFormatting.kt index a43471b317..b7640743e0 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/internal/StringFormatting.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/internal/StringFormatting.kt @@ -1,7 +1,6 @@ package dev.inmo.tgbotapi.utils.internal -import dev.inmo.tgbotapi.types.UserId -import dev.inmo.tgbotapi.types.link +import dev.inmo.tgbotapi.types.* import dev.inmo.tgbotapi.types.message.* import dev.inmo.tgbotapi.utils.extensions.* @@ -102,7 +101,7 @@ private inline fun String.hashTag(adapt: String.() -> String): String = if (star "#${adapt()}" } -internal fun String.textMentionMarkdown(userId: UserId): String = linkMarkdown(userId.link) +internal fun String.textMentionMarkdown(userId: UserId): String = linkMarkdown(userId.userLink) internal fun String.mentionMarkdown(): String = mention(String::toMarkdown) diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/formatting/LinksFormatting.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/formatting/LinksFormatting.kt index 284900af4e..ad8969379a 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/formatting/LinksFormatting.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/formatting/LinksFormatting.kt @@ -77,7 +77,7 @@ val Chat.link: String? inviteLink ?.let { return it } } if (this is PrivateChat) { - return id.link + return id.userLink } return null } diff --git a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/formatting/StringFormatting.kt b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/formatting/StringFormatting.kt index 75b491260b..a86f1c8a41 100644 --- a/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/formatting/StringFormatting.kt +++ b/tgbotapi.utils/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/utils/formatting/StringFormatting.kt @@ -109,9 +109,9 @@ private inline fun String.hashTag(adapt: String.() -> String): String = if (star } -fun String.textMentionMarkdown(userId: UserId): String = linkMarkdown(userId.link) -fun String.textMentionMarkdownV2(userId: UserId): String = linkMarkdownV2(userId.link) -fun String.textMentionHTML(userId: UserId): String = linkHTML(userId.link) +fun String.textMentionMarkdown(userId: UserId): String = linkMarkdown(userId.userLink) +fun String.textMentionMarkdownV2(userId: UserId): String = linkMarkdownV2(userId.userLink) +fun String.textMentionHTML(userId: UserId): String = linkHTML(userId.userLink) fun String.mentionMarkdown(): String = mention(String::toMarkdown)