-4

First of all a disclaimer: i am not planning on using this as a griefing thing; its purely for a friends server that i own the bot for.

So I understand how to make a 50/50 roll, and the theory of it is that the bot gets every ID of every member in a for loop and kicks them if the roll comes out as 1 (or thats what think anyway)

But what i cant do, no matter how much documentation I read, is make it work with actual code.

Can anyone please tell me how to do this, or at least point me in the right direction

Thanks in advance!

(edit: formatting)

Kaze-QS
  • 17
  • 3
  • 2
    Welcome to Stack Overflow. Check [this guide](https://stackoverflow.com/help/how-to-ask) to find out more about how to ask good questions. In short, you need to provide reproducible code snippets showing what you've tried and what went wrong. The way you're asking right now sounds like you're just looking for someone to do free work for you. – cinnaroll45 Mar 19 '20 at 21:28

1 Answers1

2

You could first get a random number between 0 and one and get the user you want to ban like this:

let number = Math.floor(Math.random() * Math.floor(1));
let user = message.mentions.members.first()

Then with a simple if statement :

if(num <1){
    //user was spared
    message.channel.send("You have been spared!")
}
else{
    //user is banned:
    member.ban()
    message.channel.send("User was banned!")
}
Aci
  • 546
  • 5
  • 22