Table of Contents

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 string

The pure UTF-8 encoding of an emoji.

Properties

Id

Gets the unique identifier for this object.

public string Id { get; }

Property Value

string

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 object

The object to compare with the current object.

Returns

bool

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 string

The raw encoding of an emoji. For example: :heart: or ❤

Returns

Emoji

Exceptions

FormatException

String is not emoji or unicode!

ToString()

Gets the Unicode representation of this emoji.

public override string ToString()

Returns

string

A string that resolves to Name.

TryParse(string?, out Emoji?)

Tries to parse an Emoji from its raw format.

public static bool TryParse(string? text, out Emoji? result)

Parameters

text string

The raw encoding of an emoji. For example:

:heart: or ❤
result Emoji

An emoji.

Returns

bool

Operators

implicit operator Emoji(string)

Parses the given string into an Emoji.

public static implicit operator Emoji(string s)

Parameters

s string

The string to parse.

Returns

Emoji

The parsed Emoji.

Exceptions

FormatException

The provided string is not emoji name or unicode.

See Also