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
|
2019-12-11 04:53:41 +00:00
|
|
|
import com.github.insanusmokrassar.TelegramBotAPI.utils.mentionHTML
|
2019-03-31 03:26:41 +00:00
|
|
|
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
|
2019-03-31 03:26:41 +00:00
|
|
|
) : 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)
|
2019-12-11 04:53:41 +00:00
|
|
|
override val asHtmlSource: String = sourceString.mentionHTML(privateChat.id)
|
2019-03-31 03:26:41 +00:00
|
|
|
}
|