Skip to content
Advertisement

How would I bypass a cetian role on a cooldown script discord.js/ command that restricts a certain command to a certain channel

This is the current code that I have, I would like to make it where if you have a certain role then you can bypass the cooldown, also if anyone knows how to make a command that restricts a certain command to a certain channel, instead of having this really long message.channel.id.

JavaScript

Advertisement

Answer

Answering Your First Question: Simply check if the member has a certain role. If they do, construct your if statement so that it will not fire if they have that role Make sure to use message.member when checking roles

JavaScript

Learn more about Roles#has

Answering your 2nd question: You can have an array of channel id’s then use includes to check if any of the id’s in the array match the current channel id

JavaScript

Learn more about Array.prototype.includes

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement