Trying to make a bot that after a member has two roles it automatically gives the verified role

Hi, I'm trying to make a bot that after checking if an user has two roles it gives the verified role and removes the two other roles alongside the unverified role. But this is my first time and I need a bit of help ;-;
6 Replies
d.js toolkit
d.js toolkit9mo 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! - Marked as resolved by staff
Texdroid
TexdroidOP9mo ago
This is how my code currently looks like. I know, very basic, but you gotta start somewhere
No description
zeyad
zeyad9mo ago
first of all you're going to need some intents, Guild and GuildMembers Second of all, you're going to need a new event listener for guildMemberUpdate then you're first going to have to check if the oldMember roles are equal to newMember roles, if so, do nothing (use a return statement) Next you're going to see how many roles this newMember has (newMember.roles.cache.size)
Unknown User
Unknown User9mo ago
Message Not Public
Sign In & Join Server To View
zeyad
zeyad9mo ago
Did they? Lol I didn't realize it
Unknown User
Unknown User9mo ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server