mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Remove some things (surprise)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
const { XIAO_TOKEN, OWNERS, XIAO_PREFIX, INVITE, XIAO_ALLOWED_GUILDS } = process.env;
|
||||
const { XIAO_TOKEN, OWNERS, XIAO_PREFIX, INVITE } = process.env;
|
||||
const path = require('path');
|
||||
const XiaoClient = require('./structures/Client');
|
||||
const client = new XiaoClient({
|
||||
@@ -11,7 +11,6 @@ const client = new XiaoClient({
|
||||
});
|
||||
const SequelizeProvider = require('./providers/Sequelize');
|
||||
const activities = require('./assets/json/activity');
|
||||
const allowedGuilds = XIAO_ALLOWED_GUILDS ? XIAO_ALLOWED_GUILDS.split(',') : null;
|
||||
|
||||
client.registry
|
||||
.registerDefaultTypes()
|
||||
@@ -57,17 +56,6 @@ client.on('ready', async () => {
|
||||
const activity = activities[Math.floor(Math.random() * activities.length)];
|
||||
client.user.setActivity(activity.text, { type: activity.type });
|
||||
}, 60000);
|
||||
if (allowedGuilds) {
|
||||
for (const guild of client.guilds.values()) {
|
||||
if (allowedGuilds.includes(guild.id)) continue;
|
||||
try {
|
||||
await guild.leave();
|
||||
console.log(`[GUILD] Left non-allowed guild ${guild.name}. (${guild.id})`);
|
||||
} catch (err) {
|
||||
console.error(`[GUILD] Failed to leave non-allowed guild ${guild.name}. (${guild.id})`, err);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
client.on('disconnect', event => {
|
||||
@@ -75,17 +63,6 @@ client.on('disconnect', event => {
|
||||
process.exit(0);
|
||||
});
|
||||
|
||||
client.on('guildCreate', async guild => {
|
||||
if (!allowedGuilds) return;
|
||||
if (allowedGuilds.includes(guild.id)) return;
|
||||
try {
|
||||
await guild.leave();
|
||||
console.log(`[GUILD] Left non-allowed guild ${guild.name}. (${guild.id})`);
|
||||
} catch (err) {
|
||||
console.error(`[GUILD] Failed to leave non-allowed guild ${guild.name}. (${guild.id})`, err);
|
||||
}
|
||||
});
|
||||
|
||||
client.on('commandRun', command => console.log(`[COMMAND] Ran command ${command.groupID}:${command.memberName}.`));
|
||||
|
||||
client.on('error', err => console.error('[ERROR]', err));
|
||||
|
||||
Reference in New Issue
Block a user