I'm making a function that has a 0.01 percent chance of banning you. But I can't seem to find a way to ban the author of the message.
Here's what I have tried - message.author.ban()
message.author returns a user object - this is the information about an account not connected to the server it is in. To get the member object, you can do message.member - this gives you the member of the server and you can add roles, change nickname, kick, ban and more on this.
The correct way is message.member.ban().