Interface IRoom
- Namespace
- HeyBox
- Assembly
- HeyBox.Net.Core.dll
表示一个通用的房间。
public interface IRoom : IEntity<ulong>
- Inherited Members
Properties
Banner
获取此房间横幅图像的 URL。
string Banner { get; }
Property Value
CreatorId
获取此房间所有者的用户 ID。
uint CreatorId { get; }
Property Value
Emotes
获取此房间的所有自定义表情。
IReadOnlyCollection<RoomEmote> Emotes { get; }
Property Value
EveryoneRole
获取此房间中的 @全体成员
全体成员角色。
IRole EveryoneRole { get; }
Property Value
Icon
获取此房间图标的 URL。
string? Icon { get; }
Property Value
IsHot
获取此房间是否热门。
bool IsHot { get; }
Property Value
IsPublic
获取此房间是否为公开房间。
bool IsPublic { get; }
Property Value
JoinedAt
获取加入到此房间的时间。
DateTimeOffset JoinedAt { get; }
Property Value
Name
获取此房间的名称。
string? Name { get; }
Property Value
PublicId
获取此房间的公开 ID。
uint? PublicId { get; }
Property Value
- uint?
Remarks
Roles
获取此房间的所有角色。
IReadOnlyCollection<IRole> Roles { get; }
Property Value
Stickers
获取此房间的所有自定义大表情。
IReadOnlyCollection<RoomSticker> Stickers { get; }
Property Value
Methods
CreateRoleAsync(Action<RoleProperties>, RequestOptions?)
在此房间内创建一个新角色。
Task<IRole> CreateRoleAsync(Action<RoleProperties> func, RequestOptions? options = null)
Parameters
func
Action<RoleProperties>一个用于填充新角色属性的委托。
options
RequestOptions发送请求时要使用的选项。
Returns
Remarks
此方法使用指定的属性创建新角色。要查看可用的属性,请参考 RoleProperties。
DeleteEmoteAsync(RoomEmote, RequestOptions?)
删除此房间内的现有自定义小表情。
Task DeleteEmoteAsync(RoomEmote emote, RequestOptions? options = null)
Parameters
emote
RoomEmote要删除的自定义小表情。
options
RequestOptions发送请求时要使用的选项。
Returns
- Task
一个表示异步删除操作的任务。
DeleteStickerAsync(RoomSticker, RequestOptions?)
删除此房间内的现有自定义大表情。
Task DeleteStickerAsync(RoomSticker sticker, RequestOptions? options = null)
Parameters
sticker
RoomSticker要删除的自定义大表情。
options
RequestOptions发送请求时要使用的选项。
Returns
- Task
一个表示异步删除操作的任务。
GetChannelAsync(ulong, CacheMode, RequestOptions?)
获取此房间内指定的频道。
Task<IRoomChannel?> GetChannelAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions? options = null)
Parameters
id
ulong要获取的频道的 ID。
mode
CacheMode指示当前方法是否应该仅从缓存中获取结果,还是可以通过 API 请求获取数据。
options
RequestOptions发送请求时要使用的选项。
Returns
- Task<IRoomChannel>
一个表示异步获取操作的任务。任务的结果包含与指定的
id
关联的频道;如果未找到,则返回null
。
GetEmoteAsync(ulong, RequestOptions?)
获取此房间的指定自定义小表情。
Task<RoomEmote?> GetEmoteAsync(ulong id, RequestOptions? options = null)
Parameters
id
ulong要获取的自定义表情的 ID。
options
RequestOptions发送请求时要使用的选项。
Returns
GetEmotesAsync(RequestOptions?)
获取此房间的所有自定义小表情。
Task<IReadOnlyCollection<RoomEmote>> GetEmotesAsync(RequestOptions? options = null)
Parameters
options
RequestOptions发送请求时要使用的选项。
Returns
- Task<IReadOnlyCollection<RoomEmote>>
一个表示异步获取操作的任务。任务的结果包含此房间的所有自定义小表情。
GetRole(ulong)
获取此房间内的角色。
IRole? GetRole(ulong id)
Parameters
id
ulong要获取的角色的 ID。
Returns
- IRole
一个表示异步获取操作的任务。任务的结果包含与指定的
id
关联的角色;如果未找到,则返回null
。
GetStickerAsync(ulong, RequestOptions?)
获取此房间的指定自定义大表情。
Task<RoomSticker?> GetStickerAsync(ulong id, RequestOptions? options = null)
Parameters
id
ulong要获取的自定义表情的 ID。
options
RequestOptions发送请求时要使用的选项。
Returns
- Task<RoomSticker>
一个表示异步获取操作的任务。任务的结果包含与指定的
id
关联的自定义大表情;如果未找到,则返回null
。
GetStickersAsync(RequestOptions?)
获取此房间的所有自定义大表情。
Task<IReadOnlyCollection<RoomSticker>> GetStickersAsync(RequestOptions? options = null)
Parameters
options
RequestOptions发送请求时要使用的选项。
Returns
- Task<IReadOnlyCollection<RoomSticker>>
一个表示异步获取操作的任务。任务的结果包含此房间的所有自定义大表情。
GetTextChannelAsync(ulong, CacheMode, RequestOptions?)
获取此房间内指定具有文字聊天能力的频道。
Task<ITextChannel?> GetTextChannelAsync(ulong id, CacheMode mode = CacheMode.AllowDownload, RequestOptions? options = null)
Parameters
id
ulong要获取的频道的 ID。
mode
CacheMode指示当前方法是否应该仅从缓存中获取结果,还是可以通过 API 请求获取数据。
options
RequestOptions发送请求时要使用的选项。
Returns
- Task<ITextChannel>
一个表示异步获取操作的任务。任务的结果包含与指定的
id
关联的频道;如果未找到,则返回null
。
Remarks
语音频道也是一种文字频道,此方法本意用于获取具有文字聊天能力的频道。如果通过此方法传入的 ID 对应的频道是语音频道,那么也会返回对应的语音频道实体。 如需获取频道的实际类型,请参考 GetChannelType(IChannel)。
ModifyEmoteAsync(RoomEmote, Action<EmoteProperties>, RequestOptions?)
修改此房间内的现有自定义小表情。
Task ModifyEmoteAsync(RoomEmote emote, Action<EmoteProperties> func, RequestOptions? options = null)
Parameters
emote
RoomEmote要修改的自定义小表情。
func
Action<EmoteProperties>一个用于设置自定义表情属性的委托。
options
RequestOptions发送请求时要使用的选项。
Returns
- Task
一个表示异步修改操作的任务。任务的结果包含修改后的自定义表情。
ModifyStickerAsync(RoomSticker, Action<EmoteProperties>, RequestOptions?)
修改此房间内的现有自定义大表情。
Task ModifyStickerAsync(RoomSticker sticker, Action<EmoteProperties> func, RequestOptions? options = null)
Parameters
sticker
RoomSticker要修改的自定义大表情。
func
Action<EmoteProperties>一个用于设置自定义表情属性的委托。
options
RequestOptions发送请求时要使用的选项。
Returns
- Task
一个表示异步修改操作的任务。任务的结果包含修改后的自定义表情。