29 lines
603 B
TypeScript
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');
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|