Issue with role addition/removal

My bot always restarts in PM2 after adding/removing a role, if I run the bot normally through node ., the bot stops responding to messages for 3-4 seconds after adding/removing a role, but there are no errors in console. Code run after the add function will sometimes run, sometimes won't
7 Replies
d.js toolkit
d.js toolkit7d ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
Benluka.dev
Benluka.dev7d ago
share the code
space
space7d ago
try {
await member.roles.add('1255562585764397118')
msg.channel.send({embeds: [embed]})
} catch (error) {
msg.reply(`@space error adding muted role\n\`\`\`js\n${error}\n\`\`\``)
msg.react("❌")
}
try {
await member.roles.add('1255562585764397118')
msg.channel.send({embeds: [embed]})
} catch (error) {
msg.reply(`@space error adding muted role\n\`\`\`js\n${error}\n\`\`\``)
msg.react("❌")
}
the msg.channel.send only runs like 30% of the time after adding the role
Benluka.dev
Benluka.dev7d ago
try adding await but as he said check logs
space
space7d ago
how do i do that?
space
space7d ago
No description
space
space7d ago
thats after adding a role ohhh shit wait right i thought its not supposed to do that hold on how do i make it so it only restarts on ".js" file change