And so, Xiao lived the rest of her days on only 11 servers.

This commit is contained in:
Daniel Odendahl Jr
2017-10-22 05:45:25 +00:00
parent 786a2c0783
commit 1983eba626
4 changed files with 20 additions and 27 deletions
+6
View File
@@ -9,6 +9,7 @@ const client = new CommandoClient({
unknownCommandResponse: false,
disabledEvents: ['TYPING_START']
});
const whitelist = require('./assets/json/whitelist');
client.registry
.registerDefaultTypes()
@@ -48,6 +49,11 @@ client.on('ready', () => {
];
client.user.setActivity(activities[Math.floor(Math.random() * activities.length)]);
}, 60000);
for (const guild of client.guilds.values()) {
if (whitelist.includes(guild.id)) continue;
console.log(`[LEAVE] Leaving guild ${guild.name}.`);
guild.leave().catch(err => console.error(`[LEAVE] Failed to leave ${guild.name}.`, err));
}
});
client.on('disconnect', event => {