Closed TheEndKing11 closed 1 week ago
What you're suggesting is not possible. The bot is using discord.py
, not discord.js
. Plus, there are already some checks for who can execute what. The current code the bot is running has yet to have them all but the dev
branch does have most in place already. It still needs some work before being used in a production setting.
You can make this happen with:
client.on('message', async message => { // Check if the user has a role with the name "Admin" if (message.member.roles.find(r => r.name === 'Admin')){ if (message.content === 'foo') { // do stuff... } else if (message.content === 'bar') { // do more stuff.. } } });
More information available here: https://stackoverflow.com/questions/70812006/discord-js-how-can-i-make-this-command-only-work-for-certain-roles-users