-
Notifications
You must be signed in to change notification settings - Fork 56
/
Copy pathindex.js
49 lines (44 loc) · 1.9 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
const Discord = require('discord.js');
const config = require('./config/config.json')
const fs = require('fs');
require('colors')
const client = new Discord.Client({
restTimeOffset: 0,
partials: ['MESSAGE', 'CHANNEL', 'REACTION', 'GUILD_MEMBER', 'USER'],
intents: [
Discord.Intents.FLAGS.GUILDS,
Discord.Intents.FLAGS.GUILD_MEMBERS,
Discord.Intents.FLAGS.GUILD_MESSAGES,
Discord.Intents.FLAGS.GUILD_VOICE_STATES,
Discord.Intents.FLAGS.GUILD_MESSAGE_REACTIONS,
Discord.Intents.FLAGS.GUILD_EMOJIS_AND_STICKERS,
],
})
client.commands = new Discord.Collection();
client.aliases = new Discord.Collection();
client.color = config.color;
/* SISTEMA DE IDIOMAS */
client.la = {};
let idiomas = fs.readdirSync('./idiomas').filter(archivo => archivo.endsWith(".json")).map(idioma => idioma.replace(/.json/, ""));
console.log(idiomas)
for(const idioma of idiomas){
client.la[idioma] = require(`./idiomas/${idioma}`)
}
Object.freeze(client.la)
function requerirhandlers() {
["command", "events", "distube", "reaccion_roles", "tickets", "sugerencias", "sorteos", "bienvenida"].forEach(handler => {
try {
require(`./handlers/${handler}`)(client, Discord)
} catch (e) {
console.warn(e)
}
})
}
requerirhandlers();
client.login(config.token).catch(() => console.log(`-[X]- NO HAS ESPECIFICADO UN TOKEN VALIDO -[X]-`.red))
/*
╔═════════════════════════════════════════════════════╗
║ || - || Desarollado por dewstouh#1088 || - || ║
║ ----------| discord.gg/MBPsvcphGf |---------- ║
╚═════════════════════════════════════════════════════╝
*/