Bulk role add/remove

Hi everyone, I want to implement a discord bot command that can be used to add/remove specific role to/from a large group of users (or in some cases all users). Is there a way to do this without getting rate limited. I have seen some other bots that implemented such features, for example I heard a carl bot can do it. Any ideas would be appreciated :)
6 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!
d.js docs
d.js docs5mo ago
:method: GuildMemberRoleManager#set() @14.16.2 Sets the roles applied to the member.
// Set the member's roles to a single role
guildMember.roles.set(['391156570408615936'])
.then(console.log)
.catch(console.error);
// Set the member's roles to a single role
guildMember.roles.set(['391156570408615936'])
.then(console.log)
.catch(console.error);
treble/luna
treble/luna5mo ago
ah in that case, no, not really you're gonna have to either space your requests or use the everyone role
rdobovic
rdobovicOP5mo ago
Hmm, what do you mean by everyone role?
treble/luna
treble/luna5mo ago
the everyone role the default role everyone has
rdobovic
rdobovicOP5mo ago
Aha, sorry for my late response, thank you for your answer. In that case spacing requests seems like the only option (at least in my case). It's a shame that there is no discord API route that can be used to assign a role to multiple users at once Again thank you for your time

Did you find this page helpful?