forked from TheBastionBot/Bastion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbastion.ts
64 lines (59 loc) · 1.8 KB
/
bastion.ts
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
/*!
* @author TRACTION (iamtraction)
* @copyright 2022
*/
import { GatewayIntentBits, Options, Partials } from "discord.js";
import { Client, Logger } from "@bastion/tesseract";
import dotenv from "dotenv";
import Settings from "./utils/settings.js";
// configure dotenv
dotenv.config();
const bastion = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildBans,
// GatewayIntentBits.GuildEmojisAndStickers,
// GatewayIntentBits.GuildIntegrations,
// GatewayIntentBits.GuildWebhooks,
// GatewayIntentBits.GuildInvites,
GatewayIntentBits.GuildVoiceStates,
GatewayIntentBits.GuildPresences,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildMessageReactions,
// GatewayIntentBits.GuildMessageTyping,
GatewayIntentBits.DirectMessages,
// GatewayIntentBits.DirectMessageReactions,
// GatewayIntentBits.DirectMessageTyping,
GatewayIntentBits.MessageContent,
// GatewayIntentBits.GuildScheduledEvents,
// GatewayIntentBits.AutoModerationConfiguration,
// GatewayIntentBits.AutoModerationExecution,
],
partials: [
Partials.Message,
Partials.Channel,
Partials.Reaction,
],
makeCache: Options.cacheWithLimits({
...Options.DefaultMakeCacheSettings,
MessageManager: {
maxSize: 5,
},
}),
sweepers: {
...Options.DefaultSweeperSettings,
messages: {
interval: 36e2,
lifetime: 9e2,
},
},
tesseractSettings: new Settings(),
});
bastion.init();
process.on("SIGINT", () => {
bastion.destroy();
bastion.disconnectMongo()
.then(() => process.exit())
.catch(Logger.error);
});