Emojis
This guide will show you how to use and interact with emojis in your Discord bot using DiSky.
Structure
The terms emoji and emote are completely different in Discord:
- An Emoji is a unicode character, that are built-in in Discord, and can be used by anyone, bots included.
- An Emote is a custom emoji, that are created by a user in a guild.
Note
As you've read, emotes are guild-specific, thus to difference two emotes with the same name, we use their IDs (the same way we do for users).
Getting and using Emojis
There's only one expression to gather an emojis:
Each IDs are unique, and are the best way to get an emote.
Warning
This method is not recommended because of the potential name conflicts and unloaded emotes.
DiSky will try to find an emote from any guild the bot is in, with the name Checkmark
.
In this case, DiSky will split the given string and apply different state of filter to determine the emote. This method can sometime be faster for a lot of emotes.
Now you got your emoji/emote, you can use it in messages (using a mention) or in reactions:
Super Reactions
To put it simply: bots can't react with super reactions. However, they can do anything else with them, such as getting them, removing them, checking if a user reacted with them, etc.
Warning
This is a Discord limitation, and there's nothing we can do about it yet. Maybe it'll come in the near future? Who knows!
Reaction Emotes
When the reaction event is fired, you can get the emote that was used to react with, but also some other information: this is called a Reaction Emote.
Tip
You can easily get any reaction emote from a reaction event using the event-reaction
expression!
There's not a lot of things about them, simply two small things:
You can check if the reaction was added by the bot itself, or not: