Class RoomEmote
- Namespace
- HeyBox
- Assembly
- HeyBox.Net.Core.dll
表示一个房间小表情符号。
public class RoomEmote : Emote, IEquatable<Emote>, IRoomEmote, IEmote, IEntity<string>, IEquatable<RoomEmote>
- Inheritance
-
RoomEmote
- Implements
- Inherited Members
Constructors
RoomEmote(ulong, string)
初始化一个 RoomEmote 的新实例。
public RoomEmote(ulong roomId, string name)
Parameters
RoomEmote(ulong, ulong, string)
初始化一个 RoomEmote 的新实例。
public RoomEmote(ulong roomId, ulong path, string extension)
Parameters
Properties
CreatedAt
获取此表情符号的创建时间。
public DateTimeOffset? CreatedAt { get; }
Property Value
Creator
获取此表情符号的创建者。
public IRoomUser? Creator { get; }
Property Value
CreatorId
获取此表情符号的创建者的 ID。
public ulong? CreatorId { get; }
Property Value
Extension
获取此表情符号的扩展名。
public string? Extension { get; }
Property Value
IsPopulated
获取此实体是否填充了真实数据。
public bool IsPopulated { get; }
Property Value
Remarks
由于黑盒语音的 Bot 能力仍处于初步阶段,HeyBox.Net 无法从网关或 API 获取所有必要数据。当此实体的数据来源于网关或 API 时,此属性值为 true。当 HeyBox.Net 需要创建实体但无法从网关或 API 获取数据时,HeyBox.Net 会创建一个仅包含 ID 的实体,此时,此属性值为 false。
Path
获取此表情符号的路径。
public ulong? Path { get; }
Property Value
Room
获取此表情符号所在的房间。
public IRoom? Room { get; }
Property Value
RoomId
获取此表情符号所在的房间的 ID。
public ulong RoomId { get; }
Property Value
Methods
Equals(RoomEmote?)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(RoomEmote? other)
Parameters
other
RoomEmoteAn object to compare with this object.
Returns
Equals(object?)
Determines whether the specified object is equal to the current object.
public override bool Equals(object? obj)
Parameters
obj
objectThe object to compare with the current object.
Returns
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
Parse(string)
从一个表情符号的原始格式中解析出一个 RoomEmote。
public static RoomEmote Parse(string text)
Parameters
text
string表情符号的原始格式。例如
[custom3358126864697663488_demo]
。
Returns
Examples
下面的示例演示了如何解析一个表情符号的原始格式:
RoomEmote emote = RoomEmote.Parse("[custom3358126864697663488_demo]");
Exceptions
- ArgumentException
无法解析
text
为一个有效的表情符号。
ToString()
返回此表情符号的原始表示。
public override string ToString()
Returns
- string
表示表情符号的原始表示(例如
[custom3358126864697663488_demo]
)。
TryParse(string, out RoomEmote?)
尝试从一个表情符号的原始格式中解析出一个 RoomEmote。
public static bool TryParse(string text, out RoomEmote? result)
Parameters
text
string表情符号的原始格式。例如
[custom3358126864697663488_demo]
。result
RoomEmote如果解析成功,则为解析出的 RoomEmote;否则为
null
。
Returns
- bool
如果解析成功,则为
true
;否则为false
。
Examples
下面的示例演示了如何解析一个表情符号的原始格式:
bool success = Emote.TryParse("[custom3358126864697663488_demo]", out Emote? emote)