Table of Contents

Class RestUserMessage

Namespace
Kook.Rest
Assembly
Kook.Net.Rest.dll

表示一个基于 REST 的用户消息。

public class RestUserMessage : RestMessage, IUpdateable, IUserMessage, IMessage, IEntity<Guid>, IDeletable
Inheritance
RestUserMessage
Implements
Inherited Members
Extension Methods

Properties

Attachments

获取此消息中包含的所有附件。

public override IReadOnlyCollection<Attachment> Attachments { get; }

Property Value

IReadOnlyCollection<Attachment>

Remarks

此属性也会包含从卡片中解析出来的附件信息。

Cards

获取此消息中包含的所有卡片。

public override IReadOnlyCollection<ICard> Cards { get; }

Property Value

IReadOnlyCollection<ICard>

Embeds

获取此消息中包含的所有嵌入式内容。

public override IReadOnlyCollection<IEmbed> Embeds { get; }

Property Value

IReadOnlyCollection<IEmbed>

IsPinned

获取此消息是否被置顶。

public override bool? IsPinned { get; }

Property Value

bool?

MentionedChannels

获取此消息中提及的所有频道。

public IReadOnlyCollection<RestGuildChannel> MentionedChannels { get; }

Property Value

IReadOnlyCollection<RestGuildChannel>

MentionedEveryone

获取此消息是否提及了全体成员。

public override bool MentionedEveryone { get; }

Property Value

bool

MentionedHere

获取此消息是否提及了在线成员。

public override bool MentionedHere { get; }

Property Value

bool

MentionedRoleIds

获取此消息中提及的所有角色的 ID。

public override IReadOnlyCollection<uint> MentionedRoleIds { get; }

Property Value

IReadOnlyCollection<uint>

MentionedRoles

获取此消息中提及的所有角色。

public IReadOnlyCollection<RestRole> MentionedRoles { get; }

Property Value

IReadOnlyCollection<RestRole>

Pokes

public override IReadOnlyCollection<RestPokeAction> Pokes { get; }

Property Value

IReadOnlyCollection<RestPokeAction>

Quote

获取消息的引用。

public IQuote? Quote { get; }

Property Value

IQuote

Tags

获取此消息中解析出的所有标签。

public override IReadOnlyCollection<ITag> Tags { get; }

Property Value

IReadOnlyCollection<ITag>

Methods

ModifyAsync(Action<MessageProperties>, RequestOptions?)

修改此消息。

public Task ModifyAsync(Action<MessageProperties> func, RequestOptions? options = null)

Parameters

func Action<MessageProperties>

一个包含修改消息属性的委托。

options RequestOptions

发送请求时要使用的选项。

Returns

Task

一个表示异步修改操作的任务。

See Also

Resolve(TagHandling, TagHandling, TagHandling, TagHandling, TagHandling)

转换消息文本中的提及与表情符号为可读形式。

public string Resolve(TagHandling userHandling = TagHandling.Name, TagHandling channelHandling = TagHandling.Name, TagHandling roleHandling = TagHandling.Name, TagHandling everyoneHandling = TagHandling.Name, TagHandling emojiHandling = TagHandling.Name)

Parameters

userHandling TagHandling

指定用户提及标签的处理方式。

channelHandling TagHandling

指定频道提及标签的处理方式。

roleHandling TagHandling

指定角色提及标签的处理方式。

everyoneHandling TagHandling

指定全体成员与在线成员提及标签的处理方式。

emojiHandling TagHandling

指定表情符号标签的处理方式。

Returns

string

转换后的消息文本。

Resolve(int, TagHandling, TagHandling, TagHandling, TagHandling, TagHandling)

转换消息文本中的提及与表情符号为可读形式。

public string Resolve(int startIndex, TagHandling userHandling = TagHandling.Name, TagHandling channelHandling = TagHandling.Name, TagHandling roleHandling = TagHandling.Name, TagHandling everyoneHandling = TagHandling.Ignore, TagHandling emojiHandling = TagHandling.Name)

Parameters

startIndex int

指定解析的起始位置。

userHandling TagHandling

指定用户提及标签的处理方式。

channelHandling TagHandling

指定频道提及标签的处理方式。

roleHandling TagHandling

指定角色提及标签的处理方式。

everyoneHandling TagHandling

指定全体成员与在线成员提及标签的处理方式。

emojiHandling TagHandling

指定表情符号标签的处理方式。

Returns

string

转换后的消息文本。