Skip to content
← Back to Community
[Node js] How to make discord bot ban users?
Profile icon
[deleted]

I am learning Node js and I already made a bot out of it. I am going to make this explaining quick so here is the point: How do I make my bot ban/kick users? I have searched it up on google and nothing is helping, so does anyone know how to make a bot ban a user? And I tried this:

Screenshot 2020-09-28 at 12.20.34 PM

But it doesn't save it.

Comments
hotnewtop
Profile icon
anasslimany2

ok

Profile icon
Coder100

read this
but the code won't work without this

Your code is now:

client.on('message', msg => { const user = msg.mentions.users.first(); msg.guild.members.ban(user); })

ALSO WHY DO YOU HAVE SO MANY client.on('message' LISTENERS? THAT IS BAD! NEVER DO THAT EVER! YOU SHOULD ONLY HAVE AT MOST 2 LISTENERS, BUT ONE SHOULD BE THE AVERAGE