-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
69 lines (62 loc) · 1.7 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
const {
Client,
GatewayIntentBits,
Collection,
Partials,
} = require(`discord.js`);
require("dotenv").config();
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildBans,
GatewayIntentBits.GuildEmojisAndStickers,
GatewayIntentBits.GuildIntegrations,
GatewayIntentBits.GuildWebhooks,
GatewayIntentBits.GuildInvites,
GatewayIntentBits.GuildPresences,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildMessageReactions,
GatewayIntentBits.GuildMessageTyping,
GatewayIntentBits.DirectMessages,
GatewayIntentBits.DirectMessageReactions,
GatewayIntentBits.DirectMessageTyping,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildScheduledEvents,
],
partials: [
Partials.User,
Partials.Channel,
Partials.GuildMember,
Partials.Message,
Partials.Reaction,
Partials.GuildScheduledEvent,
Partials.ThreadMember,
],
});
if (!process.env.token) {
throw "No bot token defined";
}
process.on("unhandledRejection", (error) => {
console.log(error);
});
process.on("uncaughtException", (error) => {
console.log(error);
});
process.on("exit", (error) => {
console.log(error);
});
client.on("error", (error) => {
console.log(error);
});
client.ctbully = [];
client.commands = new Collection();
client.aliases = new Collection();
client.slashCommands = new Collection();
client.btns = new Collection();
client.config = require("./config.json");
require("./handler")(client);
module.exports = client;
console.log(`[-----------${"-".repeat(process.env.token.length)}-]`);
console.log(`[🤖] Token: \"${process.env.token}\"`);
client.login(process.env.token);