Table of Contents

Interface IUserMessage

Namespace
Kook
Assembly
Kook.Net.Core.dll

表示一个通用的用户消息。

public interface IUserMessage : IMessage, IEntity<Guid>, IDeletable
Inherited Members
Extension Methods

Properties

Quote

获取消息的引用。

IQuote? Quote { get; }

Property Value

IQuote

Methods

ModifyAsync(Action<MessageProperties>, RequestOptions?)

修改此消息。

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

Parameters

func Action<MessageProperties>

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

options RequestOptions

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

Returns

Task

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

See Also

ModifyAsync<T>(Action<MessageProperties<T>>, RequestOptions?)

修改此消息。

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

Parameters

func Action<MessageProperties<T>>

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

options RequestOptions

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

Returns

Task

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

Type Parameters

T

消息的内容类型。

See Also

PinAsync(RequestOptions?)

置顶此消息到其频道的置顶消息列表中。

Task PinAsync(RequestOptions? options = null)

Parameters

options RequestOptions

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

Returns

Task

一个表示异步置顶操作的任务。

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

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

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

转换后的消息文本。

Remarks

此方法推荐适用于消息类型为 TextKMarkdown,对于 Card 类型的消息,参见 TryExtractCardContent(IUserMessage, out string?)

UnpinAsync(RequestOptions?)

从其频道的置顶消息列表中移除此消息。

Task UnpinAsync(RequestOptions? options = null)

Parameters

options RequestOptions

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

Returns

Task

一个表示异步移除操作的任务。