-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbot.ts
36 lines (31 loc) · 977 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
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 { Command } from "./lib/mod.ts";
import "std/dotenv/load.ts"
const bot = createBot({
token: Deno.env.get("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 BotName = bot as BotClient;
BotName.commands = new Collection();