Prune member options

So I'm trying to create a prune command for my bot and am using interaction.guild.members.prune({ roles: [], days: smth }), what would I have to add into roles so it checks everyone and not just people without roles DJS: 14.6.0 Node: 16.13.1
10 Replies
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
probablyraging
guild.roles.eveyrone or I think your guild ID is the role ID of @everyone, you could use that maybe?
CanineData
CanineDataOP3y ago
I'll try that thanks
probablyraging
Just testing this, doesn't seem to work. You might just have to fetch all roles and just add them to an array
CanineData
CanineDataOP3y ago
alright
조아오
조아오3y ago
I think for everyone You just leave the roles blank They are used by default By my knowledge, the "roles" field, is for extra roles to count in E.g, you have a members role to house all of your members Than you should include it in the roles If you do like this, you may risk kicking important users and staff
CanineData
CanineDataOP3y ago
The reason I ask is on the discord app it says all members without assigned roles, and my server uses a verification and such. But thanks all for the assistance
probablyraging
Yeah, prune only account for users without roles, not everyone, by default https://discord.js.org/#/docs/discord.js/main/typedef/GuildPruneMembersOptions
Array of roles to bypass the "...and no roles" constraint when pruning
Discord.js
Discord.js is a powerful node.js module that allows you to interact with the Discord API very easily. It takes a much more object-oriented approach than most other JS Discord libraries, making your bot's code significantly tidier and easier to comprehend.
조아오
조아오3y ago
So you could include the role of verified members If you want to prune them
CanineData
CanineDataOP3y ago
Ah thanks didn’t think of that
Want results from more Discord servers?
Add your server