Answer the question
In order to leave comments, you need to log in
How to give access to a command of a certain role?
Is it possible to give access to my team to only 1 or a couple of roles? For example, only Glav.Adminu.
function правила(robot, mess, args) {
const exampleEmbed = new MessageEmbed()
.setColor('#4C50BE')
.setTitle('правила')
.setDescription('правила')
.setFooter({ text: '12.01.2022'});
mess.author.send({ embeds: [exampleEmbed] });
}
Answer the question
In order to leave comments, you need to log in
First, get the desired role:
let adminRole = mess.guild.roles.cache.get("ID_роли");
// или //
let adminRole = mess.guild.roles.cache.find(role => role.name === "название_роли");
if (!mess.member.roles.cache.has(adminRole)) return "у пользователя отсутствует роль."
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question