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•3y ago
Message Not Public
Sign In & Join Server To View
guild.roles.eveyrone
or I think your guild ID is the role ID of @everyone, you could use that maybe?I'll try that thanks
Just testing this, doesn't seem to work. You might just have to fetch all roles and just add them to an array
alright
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
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
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.
So you could include the role of verified members
If you want to prune them
Ah thanks didn’t think of that