2023-01-11 15:06:20 -08:00
|
|
|
import config from './config.ts';
|
|
|
|
import { DEBUG, LOCALMODE } from './flags.ts';
|
|
|
|
import { createBot, enableCachePlugin, enableCacheSweepers, initLog, Intents, startBot } from './deps.ts';
|
|
|
|
import { events } from './src/events.ts';
|
2023-01-11 18:21:43 -08:00
|
|
|
import { createSlashCommands } from './src/commands/_index.ts';
|
2023-01-11 15:06:20 -08:00
|
|
|
|
|
|
|
// Initialize logging client with folder to use for logs, needs --allow-write set on Deno startup
|
|
|
|
initLog('logs', DEBUG);
|
|
|
|
|
|
|
|
// Set up the Discord Bot
|
|
|
|
const bot = enableCachePlugin(createBot({
|
|
|
|
token: LOCALMODE ? config.localToken : config.token,
|
|
|
|
intents: Intents.MessageContent | Intents.GuildMessages | Intents.DirectMessages | Intents.Guilds | Intents.GuildMessageReactions,
|
|
|
|
events,
|
|
|
|
}));
|
|
|
|
enableCacheSweepers(bot);
|
|
|
|
|
|
|
|
// Start the bot
|
2023-01-11 18:21:43 -08:00
|
|
|
await startBot(bot);
|
|
|
|
|
2023-01-28 17:58:24 -08:00
|
|
|
// Announce the slash commands so users can use them
|
2023-01-11 18:21:43 -08:00
|
|
|
await createSlashCommands(bot);
|