forked from vKxni/disco.js
-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathindex.js
59 lines (52 loc) · 1.34 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
require("dotenv").config();
const { Client, Partials, Collection } = require("discord.js");
const { TOKEN, MONGO_URL } = require("./settings/config");
const mongoose = require("mongoose");
const client = new Client({
intents: 3276799,
// intents: [
// GatewayIntentBits.Guilds,
// GatewayIntentBits.GuildMembers,
// GatewayIntentBits.MessageContent,
// GatewayIntentBits.GuildMessages,
// ],
partials: [
Partials.Channel,
Partials.Message,
Partials.User,
Partials.GuildMember,
],
failIfNotExists: false,
allowedMentions: {
parse: ["everyone", "roles", "users"],
users: [],
roles: [],
repliedUser: false,
},
});
mongoose.set("strictQuery", true);
mongoose
.connect(MONGO_URL, {
useNewUrlParser: true,
useUnifiedTopology: true,
})
.then(() => {
console.log(`> MongoDB Connected !!`);
});
// global variables
client.scommands = new Collection();
client.mcommands = new Collection();
client.cooldowns = new Collection();
client.userSettings = new Collection();
client.events = 0;
module.exports = client;
// handlers
const handlesFiles = [
"event_handler",
"slash_handler",
"cmd_handler",
"premium_handler",
];
handlesFiles.forEach((file) => require(`./handlers/${file}`)(client));
// login bot
client.login(TOKEN);