-
Notifications
You must be signed in to change notification settings - Fork 237
Emoji
SQKo edited this page Sep 20, 2022
·
3 revisions
Emojis are part of Guild (Server). See Reaction for Emoji react on a Message.
use Discord\Parts\Guild\Emoji;
An emoji object represents a custom emoji.
Requires GUILD_EMOJIS
intent
You must first get the Guild object to use the code below. Change 123123123123123123
below with the Emoji ID you want to retrieve
Cached, synchronous:
$emoji = $guild->emojis->get('id', '123123123123123123');
Emoji can be also retrieved from related objects:
-
Activity
$emoji = $activity->emoji;
emoji of the activity -
Reaction
$emoji = $reaction->emoji;
emoji of the reaction
If the code above returns null
, you may need to fetch it first (Promise, asynchronous):
$guild->emojis->fetch('123123123123123123')->done(function (Emoji $emoji) {
// ...
});
https://discord.com/developers/docs/resources/emoji#get-guild-emoji
Note: This wiki is currently Work In Progress. Consider reading the docs instead.
- Application Command (Slash based)
Command Client (Message based)
- Activity
- Application
- Guild
- Private Channel
- User
Components
-
ActionRow
- Buttons
- Option (commands)
- SelectMenu
- TextInput
Builders