-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.js
37 lines (32 loc) · 984 Bytes
/
main.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
// importing all the required libraries
const { Client, Intents, Collection } = require("discord.js");
// setting env variables
require("dotenv").config();
// connecting to mongodb
require("./mongodb");
// setup discord intents
const myIntents = new Intents();
myIntents.add(
Intents.FLAGS.GUILDS,
Intents.FLAGS.GUILD_MESSAGES,
Intents.FLAGS.GUILD_MESSAGE_REACTIONS
);
// setup client
const client = new Client({
intents: myIntents,
partials: ["MESSAGE", "REACTION"],
});
// custom collections
client.events = new Collection();
client.slashCommands = new Collection();
// running events
["eventHandler", "slashCommandHandler"].forEach((handler) => {
require(`./handlers/${handler}`)(client);
});
// logging in with discord with discord token
client.login(process.env.DISCORD_TOKEN);
/**
* Coded By Vishal Codez
* Please Don't Forget To Give Credits To Vishal Codez if You Are Using This
* Please Mention Vishal Codez / In Code Streakers, When Using This Code!
*/