-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.js
78 lines (70 loc) · 2.07 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
67
68
69
70
71
72
73
74
75
76
77
78
/* eslint-disable no-inline-comments */
//imports modules
const Discord = require("discord.js");
const { Client, Intents } = require("discord.js");
const client = new Client({
intents: [
Intents.FLAGS.GUILDS,
Intents.FLAGS.GUILD_MEMBERS,
Intents.FLAGS.GUILD_BANS,
Intents.FLAGS.GUILD_EMOJIS_AND_STICKERS,
Intents.FLAGS.GUILD_INVITES,
Intents.FLAGS.GUILD_VOICE_STATES,
Intents.FLAGS.GUILD_PRESENCES,
Intents.FLAGS.GUILD_MESSAGES,
Intents.FLAGS.GUILD_MESSAGE_REACTIONS,
Intents.FLAGS.GUILD_MESSAGE_TYPING,
Intents.FLAGS.DIRECT_MESSAGES,
Intents.FLAGS.DIRECT_MESSAGE_REACTIONS,
Intents.FLAGS.DIRECT_MESSAGE_TYPING,
],
partials: [`CHANNEL`, `MESSAGE`, `REACTION`],
autoReconnect: true,
});
const { GiveawaysManager } = require("discord-giveaways");
//imports ends
//imports config
const config = require("./config");
client.config = config;
//config ends
//collections started
client.interactions = new Discord.Collection();
client.button = new Discord.Collection();
client.slashcommand = new Discord.Collection();
client.commands = new Discord.Collection();
//collections ended
//import handlers
[`eventHandler`,"commandHandler","buttonHandler", "textCommandsHandler"]
.filter(Boolean)
.forEach(h => {
require(`./handler/${h}`)(client);
});
//import handlers ends
//start client
client.login(config.BotToken);
// giveaway code starts here \\
// Starts updating currents giveaways
client.giveawaysManager = new GiveawaysManager(client, {
storage: "./giveaways.json",
default: {
botsCanWin: false,
embedColor: "#FF0000",
embedColorEnd: "#000000",
reaction: "🎉",
lastChance: {
enabled: true,
content: "⚠️ **LAST CHANCE TO ENTER !** ⚠️",
threshold: 5000,
embedColor: "#FF0000",
},
},
});
client.giveawaysManager.on("giveawayDeleted", (giveaway) => {
const channel = client.channels.cache.find(
(channel) => channel.id === "710123089094246482"
);
channel.send(
"Giveaway with message Id " + giveaway.messageId + " was deleted."
);
});
// giveaway code ends here \\