Interface IMessageChannel
- Namespace
- HeyBox
- Assembly
- HeyBox.Net.Core.dll
表示一个通用的消息频道,可以用来发送和接收消息。
public interface IMessageChannel : IChannel, IEntity<ulong>
- Inherited Members
- Extension Methods
Methods
DeleteMessageAsync(IMessage, RequestOptions?)
删除一条消息.
Task DeleteMessageAsync(IMessage message, RequestOptions? options = null)
Parameters
message
IMessage要删除的消息。
options
RequestOptions发送请求时要使用的选项。
Returns
- Task
一个表示异步删除操作的任务。
DeleteMessageAsync(ulong, RequestOptions?)
删除一条消息。
Task DeleteMessageAsync(ulong messageId, RequestOptions? options = null)
Parameters
messageId
ulong要删除的消息的 ID。
options
RequestOptions发送请求时要使用的选项。
Returns
- Task
一个表示异步删除操作的任务。
SendCardAsync(ICard, IMessageReference?, RequestOptions?)
发送卡片消息到此消息频道。
Task<IUserMessage> SendCardAsync(ICard card, IMessageReference? messageReference = null, RequestOptions? options = null)
Parameters
card
ICard要发送的卡片。
messageReference
IMessageReference消息引用,用于回复消息。
options
RequestOptions发送请求时要使用的选项。
Returns
- Task<IUserMessage>
一个表示异步发送操作的任务。任务的结果包含所发送的消息。
SendCardsAsync(IEnumerable<ICard>, IMessageReference?, RequestOptions?)
发送卡片消息到此消息频道。
Task<IUserMessage> SendCardsAsync(IEnumerable<ICard> cards, IMessageReference? messageReference = null, RequestOptions? options = null)
Parameters
cards
IEnumerable<ICard>要发送的卡片。
messageReference
IMessageReference消息引用,用于回复消息。
options
RequestOptions发送请求时要使用的选项。
Returns
- Task<IUserMessage>
一个表示异步发送操作的任务。任务的结果包含所发送的消息。
SendFileAsync(FileAttachment, IMessageReference?, RequestOptions?)
发送文件到此消息频道。
Task<IUserMessage> SendFileAsync(FileAttachment attachment, IMessageReference? messageReference = null, RequestOptions? options = null)
Parameters
attachment
FileAttachment文件的附件信息。
messageReference
IMessageReference消息引用,用于回复消息。
options
RequestOptions发送请求时要使用的选项。
Returns
- Task<IUserMessage>
一个表示异步发送操作的任务。任务的结果包含所发送的消息。
SendFileAsync(Stream, string, AttachmentType, Size?, IMessageReference?, RequestOptions?)
发送文件到此消息频道。
Task<IUserMessage> SendFileAsync(Stream stream, string filename, AttachmentType type = AttachmentType.Image, Size? imageSize = null, IMessageReference? messageReference = null, RequestOptions? options = null)
Parameters
stream
Stream文件的流。
filename
string文件名。
type
AttachmentType文件的媒体类型。
imageSize
Size?图片文件的图像尺寸。
messageReference
IMessageReference消息引用,用于回复消息。
options
RequestOptions发送请求时要使用的选项。
Returns
- Task<IUserMessage>
一个表示异步发送操作的任务。任务的结果包含所发送的消息。
SendFileAsync(string, string?, AttachmentType, Size?, IMessageReference?, RequestOptions?)
发送文件到此消息频道。
Task<IUserMessage> SendFileAsync(string path, string? filename = null, AttachmentType type = AttachmentType.Image, Size? imageSize = null, IMessageReference? messageReference = null, RequestOptions? options = null)
Parameters
path
string文件的路径。
filename
string文件名。
type
AttachmentType文件的媒体类型。
imageSize
Size?图片文件的图像尺寸。
messageReference
IMessageReference消息引用,用于回复消息。
options
RequestOptions发送请求时要使用的选项。
Returns
- Task<IUserMessage>
一个表示异步发送操作的任务。任务的结果包含所发送的消息。
SendTextAsync(string, IEnumerable<FileAttachment>?, IMessageReference?, RequestOptions?)
发送文本消息到此消息频道。
Task<IUserMessage> SendTextAsync(string text, IEnumerable<FileAttachment>? imageFileInfos = null, IMessageReference? messageReference = null, RequestOptions? options = null)
Parameters
text
string要发送的文本。
imageFileInfos
IEnumerable<FileAttachment>图片文件的信息。
messageReference
IMessageReference消息引用,用于回复消息。
options
RequestOptions发送请求时要使用的选项。
Returns
- Task<IUserMessage>
一个表示异步发送操作的任务。任务的结果包含所发送的消息。