Answer the question
In order to leave comments, you need to log in
Issuing a role in nodeJs does not work, why?
setTimeout(() => {
// remove 'Muted' role
target.roles.remove('853014492690251776')
const exampleEmbed = new Discord.MessageEmbed()
.setColor('#4f5097')
.setTitle(target.displayName + " returned gag ")
mess.channel.send(exampleEmbed);
}, ms(args[1])); // trigger function after specified time
}
Throws an error
UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Permissions
After checking, I noticed that this error occurs when adding/remove the role
But the command is executed
Answer the question
In order to leave comments, you need to log in
The error is not in setTimeout, but in the fact that your token does not have permission to read the requested data
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question