-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
68 lines (57 loc) · 2.18 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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
console.clear();
const { Client, Collection } = require("discord.js");
const fs = require("fs");
const chalk = require('chalk');
const config = require("./config.json");
const db = require("../database/index")
const users = new Map();
const client = new Client({
intents: 32767
});
console.clear();
console.log(chalk.blue(chalk.bold(`System`)), (chalk.white(`>>`)), (chalk.green(`Starting up`)), (chalk.white(`...`)))
console.log(`\u001b[0m`)
console.log(chalk.red(`© C.E.O @YOUR BOT NAME - ${new Date().getFullYear()}`))
console.log(chalk.red(`© C.E.O @ConsterSolutions ᴛᴍ`))
console.log(chalk.red(`© C.E.O © Developer by TryReturn ᴛᴍ`))
console.log(`\u001b[0m`)
console.log(`\u001b[0m`)
console.log(chalk.blue(chalk.bold(`System`)), (chalk.white(`>>`)), chalk.red(`Version ${require(`${process.cwd()}/package.json`).version}`), (chalk.green(`loaded`)))
console.log(`\u001b[0m`);
client.commands = new Collection();
client.slash_commands = new Collection();
client.aliases = new Collection();
client.events = new Collection();
client.categories = fs.readdirSync("./commands");
const { GiveawaysManager } = require('discord-giveaways');
client.giveawaysManager = new GiveawaysManager(client, {
storage: "./giveaways.json",
default: {
botsCanWin: false,
embedColorEnd: `RED`,
lastChance: {
enabled: true,
content: '⚠️ **Última oportunidad de entrar** ⚠️',
threshold: 5000,
embedColor: `RED`,
reaction: 'CUSTOM_EMOJI_ID'
}
}
});
module.exports = client;
["prefix", "slash", "event"].forEach(handler => {
require(`./handlers/${handler}`)(client);
});
process.on("uncaughtException", (err) => {
console.error('[ERROR] >> Uncaught Exception:', err);
});
process.on('unhandledRejection', err => {
console.log(`[ERROR] >> Unhandled promise rejection: ${err.message}.`);
console.log(err);
});
const AUTH = process.env.TOKEN || config.client.TOKEN;
if (!AUTH) {
console.warn("[WARN] >> El Token del bot es invalido o no esta correcto.").then(async () => process.exit(1));
} else {
client.login(AUTH).catch(() => console.log("[WARN] >> Enable the 3 Gateaway Intents."));
}