TelegramMessageEntity

@SerialName(value = "telegram.m.message_entity")
sealed class TelegramMessageEntity : TelegramMessageElement, PlainText(source)

A TelegramMessageElement for MessageEntity.

发送

当发送一个或多个 TelegramMessageEntity 时, 它们会自动聚合为 textentities

例如:

send(
createTextLink("GitHub", "https://github.com/") +
",Hello,".toText() +
create("1=1", MessageEntityType.CODE)
)

发送时会产生大概这样的 Message:

{
...
"text": "GitHub,Hello,1=1",
"entities": [
{
"type": "text_link",
"offset": 0,
"length": 6
},
{
"type": "code",
"offset": 13,
"length": 3
}
]
}

Inheritors

Constructors

Link copied to clipboard
protected constructor()

Types

Link copied to clipboard
object Companion
Link copied to clipboard
@SerialName(value = "telegram.m.message_entity.custom_emoji")
class CustomEmoji : TelegramMessageEntity

An implementation with type MessageEntityType.PRE for TelegramMessageEntity.

Link copied to clipboard
@SerialName(value = "telegram.m.message_entity.pre")
class Pre : TelegramMessageEntity

An implementation with type MessageEntityType.PRE for TelegramMessageEntity.

Link copied to clipboard
@SerialName(value = "telegram.m.message_entity.simple")
class Simple : TelegramMessageEntity

A simple implementation for TelegramMessageEntity.

Link copied to clipboard
@SerialName(value = "telegram.m.message_entity.text_link")
class TextLink : TelegramMessageEntity

An implementation with type MessageEntityType.TEXT_LINK for TelegramMessageEntity.

Link copied to clipboard
@SerialName(value = "telegram.m.message_entity.text_mention")
class TextMention : TelegramMessageEntity, MentionMessage

An implementation with type MessageEntityType.TEXT_MENTION for TelegramMessageEntity.

Properties

Link copied to clipboard

The MessageEntity (from received message event). null if not from event.

Link copied to clipboard
abstract override val text: String
Link copied to clipboard
abstract val type: String

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String