wynn/ts/src/cmd/bot.ts
2025-02-26 22:06:55 -06:00

29 lines
603 B
TypeScript

import { Command } from 'clipanion';
import * as BotCommands from "#/slashcommands";
// di
import "#/services/pg"
import { DISCORD_GUILD_ID } from '#/constants';
import { bot } from '#/bot';
import { events } from '#/botevent';
export class BotCommand extends Command {
static paths = [['bot']];
async execute() {
bot.events = events
console.log('registring slash commands');
await bot.rest.upsertGuildApplicationCommands(DISCORD_GUILD_ID, Object.values(BotCommands))
console.log('connecting bot to gateway');
await bot.start();
console.log('bot connected');
}
}