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 toolkit5mo 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.dev5mo ago
share the code
space
spaceOP5mo 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.dev5mo ago
try adding await but as he said check logs
space
spaceOP5mo ago
how do i do that?
space
spaceOP5mo ago
No description
space
spaceOP5mo 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
Want results from more Discord servers?
Add your server