-
Notifications
You must be signed in to change notification settings - Fork 56
/
Copy pathindex.js
48 lines (42 loc) · 1.99 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
const Discord = require('discord.js');
const config = require('./config/config.json')
const fs = require('fs');
require('colors')
const client = new Discord.Client({
intents: [
Discord.GatewayIntentBits.Guilds,
Discord.GatewayIntentBits.GuildMembers,
Discord.GatewayIntentBits.GuildMessages,
Discord.GatewayIntentBits.MessageContent,
Discord.GatewayIntentBits.GuildVoiceStates,
Discord.GatewayIntentBits.GuildMessageReactions,
Discord.GatewayIntentBits.GuildEmojisAndStickers,
],
partials: [Discord.Partials.User, Discord.Partials.Channel, Discord.Partials.GuildMember, Discord.Partials.Message, Discord.Partials.Reaction]
})
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/, ""));
for(const idioma of idiomas){
client.la[idioma] = require(`./idiomas/${idioma}`)
}
Object.freeze(client.la);
//Cargamos los handlers
fs.readdirSync('./handlers').forEach(handler => {
try {
require(`./handlers/${handler}`)(client, Discord);
} catch (e) {
console.log(`ERROR EN EL HANDLER ${handler}`.red)
console.log(e)
}
});
client.login(config.token).catch(() => console.log(`-[X]- NO HAS ESPECIFICADO UN TOKEN VALIDO O TE FALTAN INTENTOS -[X]-\n [-] ACTIVA LOS INTENTOS EN https://discord.dev [-]`.red))
/*
╔═════════════════════════════════════════════════════╗
║ || - || Desarrollado por dewstouh#1088 || - || ║
║ ----------| discord.gg/MBPsvcphGf |---------- ║
╚═════════════════════════════════════════════════════╝
*/