Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

One-off script to kick people out of a server #448

Open
Picowchew opened this issue Feb 14, 2023 · 1 comment
Open

One-off script to kick people out of a server #448

Picowchew opened this issue Feb 14, 2023 · 1 comment
Labels
request Request for a new feature or other modification

Comments

@Picowchew
Copy link
Collaborator

Description of proposed feature

Having a one-off script to kick people out of a server would be helpful so one does not have to temporarily add code to the bot every time that they want to do so. Kicking people out would occur on bot startup.

How can the new feature be used?

This one-off script would be used for event servers, such as Bootcamp and Project Program.

Additional comments

The following code could be used as a template:

const memberList = await (
  await client.guilds.fetch("guild-id-here")
).members.fetch();
memberList.forEach((member) => {
  if (
    !member.roles.cache.find((role) =>
      [
        "role-name",
        "role-name2",
        "role-name3",
        "role-name4",
        "role-name5",
      ].includes(role.name)
    )
  )
    member.kick();
});

This one-off script could be run with a flag, in which the guild ID and list of role names would be arguments as well.

@Picowchew Picowchew added the request Request for a new feature or other modification label Feb 14, 2023
@Fan-Yang-284
Copy link
Contributor

Added masskick feature to codey-bootcamp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
request Request for a new feature or other modification
Projects
None yet
Development

No branches or pull requests

2 participants