Emoji class

const emoji = new Emoji(emoji, addon, guild);

constructor

The Permissions class provides three required arguments. The first argument is the Discord.js Emoji class where it can collect the data from. The second argument is a Zyno Bot Addons Addon class of the addon where the emoji belongs to. The third argument is the Zyno Bot Addons Guild class of the guild where the emoji belongs to.

Properties

id

The id of the emoji and is a Twitter snowflake.

name

The name of the emoji.

animated

A boolean which defines whether the emoji is animated or not.

string

The emoji as a string to send in the Discord channel.

creator

An instance of the Zyno Bot Addons User class which defines the creator of the emoji.

created

An instance of the NodeJS built-in Date class which defines the time when the emoji was created.

createdTimestamp

A number which represents the timestamp of the time when the emoji was created.

guild

The Zyno Bot Addons Guild class which defines in which guild the emoji belongs.

Functions

getURL()

emoji.getURL() : string;

Returns the url of the image of the emoji.

setName

emoji.setName(name: string, reason?: string) : Promise<Emoji>;

Updates the name of the current emoji. The function returns a Promise which returns the Emoji class once the Promise has been fulfilled.

ArgumentDescription

name

The new name you would like to give the emoji. The name must be a string between 1-100 characters.

reason

The reason to change the emoji's name. This must be a string between 1-512 characters, but is not required.

updateCreator

emoji.updateCreator() : Promise<Emoji>;

Updates the creator property in case the creator has changed something to itself, like a username change. The function returns a Promise which returns the Emoji class once the Promise is fulfilled.

delete

emoji.delete(reason?: string) : Promise<void>;

Deletes the emoji. The function returns a Promise which is fulfilled once the emoji has been deleted.

ArgumentDescription

reason

The reason to delete the emoji. This must be a string between 1-512 characters, but is not required.

Last updated