1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-06-29 04:47:48 +00:00
tgbotapi/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/MessageEntity/TextMentionMessageEntity.kt

25 lines
970 B
Kotlin
Raw Normal View History

2018-12-26 08:07:24 +00:00
package com.github.insanusmokrassar.TelegramBotAPI.types.MessageEntity
import com.github.insanusmokrassar.TelegramBotAPI.types.User
2019-12-11 04:18:12 +00:00
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.PrivateChat
import com.github.insanusmokrassar.TelegramBotAPI.utils.mentionHTML
import com.github.insanusmokrassar.TelegramBotAPI.utils.mentionMarkdown
2018-12-26 08:07:24 +00:00
class TextMentionMessageEntity(
override val offset: Int,
override val length: Int,
override val sourceString: String,
2019-12-11 04:18:12 +00:00
val privateChat: PrivateChat
) : MessageEntity {
2019-12-11 04:18:12 +00:00
@Deprecated("Deprecated due to the fact that there is more common constructor")
constructor(
offset: Int,
length: Int,
sourceString: String,
user: User
) : this(offset, length, sourceString, user as PrivateChat)
override val asMarkdownSource: String = sourceString.mentionMarkdown(privateChat.id)
override val asHtmlSource: String = sourceString.mentionHTML(privateChat.id)
}