-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathindex.js
44 lines (40 loc) · 1.2 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
const Discord = require('discord.js');
const client = new Discord.Client({
intents: [
'GUILDS',
'GUILD_MESSAGE_REACTIONS',
'GUILD_MEMBERS'
]
});
require('dotenv').config();
client.commands = new Discord.Collection();
const { GiveawaysManager } = require('discord-giveaways');
require('colors');
const fs = require('fs');
// setup giveaway manager config
client.giveawaysManager = new GiveawaysManager(client, {
default: {
botsCanWin: false,
embedColor: "#00FFC1",
reaction: "🎉",
embedColorEnd: "#ff0000",
lastChance: {
enabled: true,
content: "⚠️ **LAST CHANCE TO ENTER !** ⚠️",
threshold: 10000,
embedColor: "#FF0000"
}
}
})
const arr = ["handlers", "events"]
arr.forEach(handler => {
require(`./handlers/${handler}`)(client);
});
// loop giveaways events files
const giveawayEvents = fs.readdirSync('./events/giveaways').filter(file => file.endsWith('.js'));
for (const file of giveawayEvents) {
console.log(`[Giveaways Events] Loading giveaways event: ${file}`.yellow);
const event = require(`./events/giveaways/${file}`);
client.giveawaysManager.on(file.split(".")[0], event.bind(null, client));
};
client.login(process.env.token);