Class Emoji
- Namespace
- Kook
- Assembly
- Kook.Net.Core.dll
A Unicode emoji.
public class Emoji : IEmote, IEntity<string>
- Inheritance
-
Emoji
- Implements
- Inherited Members
Constructors
Emoji(string)
Initializes a new Emoji class with the provided Unicode.
public Emoji(string unicode)
Parameters
unicode
stringThe pure UTF-8 encoding of an emoji.
Properties
Id
Gets the unique identifier for this object.
public string Id { get; }
Property Value
Name
Gets the display name or Unicode representation of this emote.
public string Name { get; }
Property Value
- string
A string representing the display name or the Unicode representation (e.g.
🤔
) of this emote.
Methods
Equals(object?)
Determines whether the specified emoji is equal to the current one.
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?)
Parse an Emoji from its raw format.
public static Emoji Parse(string? emojiStr)
Parameters
emojiStr
stringThe raw encoding of an emoji. For example:
:heart: or ❤
Returns
Exceptions
- FormatException
String is not emoji or unicode!
ToString()
Gets the Unicode representation of this emoji.
public override string ToString()
Returns
TryParse(string?, out Emoji?)
Tries to parse an Emoji from its raw format.
public static bool TryParse(string? text, out Emoji? result)
Parameters
Returns
Operators
implicit operator Emoji(string)
Parses the given string into an Emoji.
public static implicit operator Emoji(string s)
Parameters
s
stringThe string to parse.
Returns
Exceptions
- FormatException
The provided string is not emoji name or unicode.
- See Also