Table of Contents

Interface IDMChannel

Namespace
Kook
Assembly
Kook.Net.Core.dll

表示一个通用的私聊频道。

public interface IDMChannel : IMessageChannel, IPrivateChannel, IChannel, IEntity<ulong>, IEntity<Guid>
Inherited Members
Extension Methods

Properties

ChatCode

获取此私聊频道的聊天代码。

Guid ChatCode { get; }

Property Value

Guid

Remarks

此属性的值与 Id 相同。

Id

获取此私聊频道的唯一标识符。

Guid Id { get; }

Property Value

Guid

Remarks

此属性的值与 ChatCode 相同。

Recipient

获取参与到此私聊频道的另外一位用户。

IUser Recipient { get; }

Property Value

IUser

Methods

CloseAsync(RequestOptions?)

关闭此私聊频道,将其从您的频道列表中移除。

Task CloseAsync(RequestOptions? options = null)

Parameters

options RequestOptions

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

Returns

Task

一个表示异步关闭操作的任务。

SendCardAsync(ICard, IQuote?, RequestOptions?)

发送卡片消息到此消息频道。

Task<Cacheable<IUserMessage, Guid>> SendCardAsync(ICard card, IQuote? quote = null, RequestOptions? options = null)

Parameters

card ICard

要发送的卡片。

quote IQuote

消息引用,用于回复消息。

options RequestOptions

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

Returns

Task<Cacheable<IUserMessage, Guid>>

一个表示异步发送操作的任务。任务的结果包含所发送消息的可延迟加载的消息对象。

SendCardsAsync(IEnumerable<ICard>, IQuote?, RequestOptions?)

发送卡片消息到此消息频道。

Task<Cacheable<IUserMessage, Guid>> SendCardsAsync(IEnumerable<ICard> cards, IQuote? quote = null, RequestOptions? options = null)

Parameters

cards IEnumerable<ICard>

要发送的卡片。

quote IQuote

消息引用,用于回复消息。

options RequestOptions

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

Returns

Task<Cacheable<IUserMessage, Guid>>

一个表示异步发送操作的任务。任务的结果包含所发送消息的可延迟加载的消息对象。

SendFileAsync(FileAttachment, IQuote?, RequestOptions?)

发送文件到此消息频道。

Task<Cacheable<IUserMessage, Guid>> SendFileAsync(FileAttachment attachment, IQuote? quote = null, RequestOptions? options = null)

Parameters

attachment FileAttachment

文件的附件信息。

quote IQuote

消息引用,用于回复消息。

options RequestOptions

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

Returns

Task<Cacheable<IUserMessage, Guid>>

一个表示异步发送操作的任务。任务的结果包含所发送消息的可延迟加载的消息对象。

SendFileAsync(Stream, string, AttachmentType, IQuote?, RequestOptions?)

发送文件到此消息频道。

Task<Cacheable<IUserMessage, Guid>> SendFileAsync(Stream stream, string filename, AttachmentType type = AttachmentType.File, IQuote? quote = null, RequestOptions? options = null)

Parameters

stream Stream

文件的流。

filename string

文件名。

type AttachmentType

文件的媒体类型。

quote IQuote

消息引用,用于回复消息。

options RequestOptions

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

Returns

Task<Cacheable<IUserMessage, Guid>>

一个表示异步发送操作的任务。任务的结果包含所发送消息的可延迟加载的消息对象。

SendFileAsync(string, string?, AttachmentType, IQuote?, RequestOptions?)

发送文件到此消息频道。

Task<Cacheable<IUserMessage, Guid>> SendFileAsync(string path, string? filename = null, AttachmentType type = AttachmentType.File, IQuote? quote = null, RequestOptions? options = null)

Parameters

path string

文件的路径。

filename string

文件名。

type AttachmentType

文件的媒体类型。

quote IQuote

消息引用,用于回复消息。

options RequestOptions

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

Returns

Task<Cacheable<IUserMessage, Guid>>

一个表示异步发送操作的任务。任务的结果包含所发送消息的可延迟加载的消息对象。

SendTextAsync(string, IQuote?, RequestOptions?)

发送文本消息到此消息频道。

Task<Cacheable<IUserMessage, Guid>> SendTextAsync(string text, IQuote? quote = null, RequestOptions? options = null)

Parameters

text string

要发送的文本。

quote IQuote

消息引用,用于回复消息。

options RequestOptions

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

Returns

Task<Cacheable<IUserMessage, Guid>>

一个表示异步发送操作的任务。任务的结果包含所发送消息的可延迟加载的消息对象。