Skip to content

Latest commit

 

History

History
22 lines (15 loc) · 855 Bytes

README.md

File metadata and controls

22 lines (15 loc) · 855 Bytes

📢 All about adding custom emojis to Discord Roles is here!

You can easily execute the steps with an eval command.

Discord.js actually has that functionality built-in with the GuildEmojiRoleManager class. The default collection is empty, making every emote accessible to every role. However, you can change that using the .add(), .remove(), and .set() methods.

Here's how you can use it for your command;

message.guild.emojis.cache.get('<Emote ID>') // first, get the emoji .roles // then the current role restrictions (default: none) .add(['<Role ID>', '<Role ID>'); // then add, set, or remove the specified roles

To get the emoji's ID:

\:smilecat: => <:smilecat:918050724808642602>

Example:

message.guild.emojis.cache.get('918050724808642602').roles.add('917087202100543539');