-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
32 lines (25 loc) · 812 Bytes
/
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
const {
Client,
GatewayIntentBits,
Partials,
Collection,
} = require("discord.js");
const { Guilds, GuildMembers, GuildMessages } = GatewayIntentBits;
const { User, Message, GuildMember, ThreadMember } = Partials;
const client = new Client({
intents: [Guilds, GuildMembers, GuildMessages],
partials: [User, Message, GuildMember, ThreadMember],
});
const { connect } = require("mongoose");
client.config = require("./config.json");
client.events = new Collection();
client.commands = new Collection();
connect(client.config.Database, {}).then(() =>
console.log("Der Bot ist mit der Datenbank verbunden!")
);
// Event Handler
const { loadEvents } = require("./Handlers/Events");
loadEvents(client);
// Anti-Crash
require("./Handlers/Anti-Crash.js")(client);
client.login(client.config.Token);