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
Remarks
此属性的值与 Id 相同。
Id
获取此私聊频道的唯一标识符。
Guid Id { get; }
Property Value
Remarks
此属性的值与 ChatCode 相同。
Recipient
获取参与到此私聊频道的另外一位用户。
IUser Recipient { get; }
Property Value
Methods
CloseAsync(RequestOptions?)
关闭此私聊频道,将其从您的频道列表中移除。
Task CloseAsync(RequestOptions? options = null)
Parameters
optionsRequestOptions发送请求时要使用的选项。
Returns
- Task
一个表示异步关闭操作的任务。
SendCardAsync(ICard, IQuote?, RequestOptions?)
发送卡片消息到此消息频道。
Task<Cacheable<IUserMessage, Guid>> SendCardAsync(ICard card, IQuote? quote = null, RequestOptions? options = null)
Parameters
cardICard要发送的卡片。
quoteIQuote消息引用,用于回复消息。
optionsRequestOptions发送请求时要使用的选项。
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
cardsIEnumerable<ICard>要发送的卡片。
quoteIQuote消息引用,用于回复消息。
optionsRequestOptions发送请求时要使用的选项。
Returns
- Task<Cacheable<IUserMessage, Guid>>
一个表示异步发送操作的任务。任务的结果包含所发送消息的可延迟加载的消息对象。
SendCardsAsync<T>(ulong, T, IQuote?, JsonSerializerOptions?, RequestOptions?)
发送卡片消息到此消息频道。
Task<Cacheable<IUserMessage, Guid>> SendCardsAsync<T>(ulong templateId, T parameters, IQuote? quote = null, JsonSerializerOptions? jsonSerializerOptions = null, RequestOptions? options = null)
Parameters
templateIdulong消息模板的 ID。
parametersT传入消息模板的参数。
quoteIQuote消息引用,用于回复消息。
jsonSerializerOptionsJsonSerializerOptions序列化模板参数时要使用的序列化选项。
optionsRequestOptions发送请求时要使用的选项。
Returns
- Task<Cacheable<IUserMessage, Guid>>
一个表示异步发送操作的任务。任务的结果包含所发送消息的可延迟加载的消息对象。
Type Parameters
T参数的类型。
SendFileAsync(FileAttachment, IQuote?, RequestOptions?)
发送文件到此消息频道。
Task<Cacheable<IUserMessage, Guid>> SendFileAsync(FileAttachment attachment, IQuote? quote = null, RequestOptions? options = null)
Parameters
attachmentFileAttachment文件的附件信息。
quoteIQuote消息引用,用于回复消息。
optionsRequestOptions发送请求时要使用的选项。
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
streamStream文件的流。
filenamestring文件名。
typeAttachmentType文件的媒体类型。
quoteIQuote消息引用,用于回复消息。
optionsRequestOptions发送请求时要使用的选项。
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
pathstring文件的路径。
filenamestring文件名。
typeAttachmentType文件的媒体类型。
quoteIQuote消息引用,用于回复消息。
optionsRequestOptions发送请求时要使用的选项。
Returns
- Task<Cacheable<IUserMessage, Guid>>
一个表示异步发送操作的任务。任务的结果包含所发送消息的可延迟加载的消息对象。
SendTextAsync(string, IQuote?, RequestOptions?)
发送文本消息到此消息频道。
Task<Cacheable<IUserMessage, Guid>> SendTextAsync(string text, IQuote? quote = null, RequestOptions? options = null)
Parameters
textstring要发送的文本。
quoteIQuote消息引用,用于回复消息。
optionsRequestOptions发送请求时要使用的选项。
Returns
- Task<Cacheable<IUserMessage, Guid>>
一个表示异步发送操作的任务。任务的结果包含所发送消息的可延迟加载的消息对象。
SendTextAsync<T>(ulong, T, IQuote?, JsonSerializerOptions?, RequestOptions?)
发送文本消息到此消息频道。
Task<Cacheable<IUserMessage, Guid>> SendTextAsync<T>(ulong templateId, T parameters, IQuote? quote = null, JsonSerializerOptions? jsonSerializerOptions = null, RequestOptions? options = null)
Parameters
templateIdulong消息模板的 ID。
parametersT传入消息模板的参数。
quoteIQuote消息引用,用于回复消息。
jsonSerializerOptionsJsonSerializerOptions序列化模板参数时要使用的序列化选项。
optionsRequestOptions发送请求时要使用的选项。
Returns
- Task<Cacheable<IUserMessage, Guid>>
一个表示异步发送操作的任务。任务的结果包含所发送消息的可延迟加载的消息对象。
Type Parameters
T参数的类型。