Skip to content

Instantly share code, notes, and snippets.

@jbwar22
Last active April 17, 2018 22:39
Show Gist options
  • Save jbwar22/699cd01ab4876c7d3d318e5f73633be8 to your computer and use it in GitHub Desktop.
Save jbwar22/699cd01ab4876c7d3d318e5f73633be8 to your computer and use it in GitHub Desktop.
Unban and print users
var Discord = require('discord.js');
var bot = new Discord.Client();
bot.on('message', message => {
if(message.content == '!invban'){
message.guild.fetchBans().then(bans => {
bans.forEach(user => {
console.log(user.username + '#' + user.tag);
user.send('MESSAGE / INVITE LINK');
message.guild.unban(user);
});
});
}
});
bot.login('APP KEY');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment