Answer the question
In order to leave comments, you need to log in
A bug in the warn command where the code does not write a message. What to do?
The error looks like this:
Code that has this error:
let member = message.guild.member(message.mentions.users.first()
|| message.guild.members.get(args[0])
);
if(message.author.roles.position <= member.roles.position) return message.channel.send(`У ${member.username} роль выше, чем у вас!`)
Answer the question
In order to leave comments, you need to log in
and you are not confused by the aspect that it message.authordoes not have an attribute roles, especially position?
+ you haven't defined which role to check for the position
, and in general, why do you define the position of the user's role if it is the same for all users?
if you want to check the position of a certain role, just like this:
let role = message.guild.roles.cache.find("name", "название_роли") // нашли роль
message.channel.send(role.position) // отправили в чат её позицию
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question