A
A
Ainsoalgonz2021-06-12 01:22:09
JavaScript
Ainsoalgonz, 2021-06-12 01:22:09

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

1 answer(s)
V
Vasily Bannikov, 2021-06-12
@vabka

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 question

Ask a Question

731 491 924 answers to any question