1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-26 03:58:44 +00:00

fix of build

This commit is contained in:
InsanusMokrassar 2022-08-04 18:15:51 +06:00
parent 92407c9010
commit 48c4a3156b
4 changed files with 9 additions and 11 deletions

View File

@ -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()

View File

@ -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)

View File

@ -77,7 +77,7 @@ val Chat.link: String?
inviteLink ?.let { return it }
}
if (this is PrivateChat) {
return id.link
return id.userLink
}
return null
}

View File

@ -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)