generated from Glan-Sheep/Discordeno-Template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbot.ts
38 lines (32 loc) · 995 Bytes
/
bot.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
import { createBot, Collection, GatewayIntents } from "discordeno/mod.ts";
import {
BotWithCache,
enableCachePlugin,
enableCacheSweepers,
} from "discordeno/plugins/cache/mod.ts";
import {
BotWithHelpersPlugin,
enableHelpersPlugin,
} from "discordeno/plugins/helpers/mod.ts";
import { enablePermissionsPlugin } from "discordeno/plugins/permissions/mod.ts";
import { config } from "dotenv";
import { Command } from "./lib/mod.ts";
const env = config();
const bot = createBot({
token: env["TOKEN"],
intents:
GatewayIntents.Guilds |
GatewayIntents.GuildMessages |
GatewayIntents.MessageContent,
events: {},
});
// Enable All Plugins
enableHelpersPlugin(bot);
enableCachePlugin(bot);
enableCacheSweepers(bot as BotWithCache);
enablePermissionsPlugin(bot as BotWithCache);
export interface BotClient extends BotWithCache<BotWithHelpersPlugin> {
commands: Collection<string, Command>;
}
export const ChatGPT = bot as BotClient;
ChatGPT.commands = new Collection();