Table of Contents

Class RestTextChannel

Namespace
HeyBox.Rest
Assembly
HeyBox.Net.Rest.dll

表示房间中一个基于 REST 的具有文字聊天能力的频道,可以发送和接收消息。

public class RestTextChannel : RestRoomChannel, IRestMessageChannel, ITextChannel, INestedChannel, IRoomChannel, IMentionable, IMessageChannel, IChannel, IEntity<ulong>
Inheritance
RestTextChannel
Implements
Inherited Members
Extension Methods

Properties

Mention

获取一个用于提及此对象的格式化字符串。

public string Mention { get; }

Property Value

string

Methods

DeleteMessageAsync(IMessage, RequestOptions?)

删除一条消息.

public Task DeleteMessageAsync(IMessage message, RequestOptions? options = null)

Parameters

message IMessage

要删除的消息。

options RequestOptions

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

Returns

Task

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

DeleteMessageAsync(ulong, RequestOptions?)

删除一条消息。

public Task DeleteMessageAsync(ulong messageId, RequestOptions? options = null)

Parameters

messageId ulong

要删除的消息的 ID。

options RequestOptions

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

Returns

Task

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

SendCardAsync(ICard, IMessageReference?, RequestOptions?)

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

public 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?)

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

public 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?)

发送文件到此消息频道。

public 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?)

发送文件到此消息频道。

public 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?)

发送文件到此消息频道。

public 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?)

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

public 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>

一个表示异步发送操作的任务。任务的结果包含所发送的消息。