Add commandManager and the first slash command

the command allows for summining the bot without sending an actual mention message
that might hang in the chat log sent to openAi, consuming tokens
This commit is contained in:
Wroclaw 2023-05-08 08:53:06 +02:00
parent 56a0e686b0
commit 8b4b35454b
6 changed files with 124 additions and 2 deletions

View file

@ -4,6 +4,7 @@ import { PrismaClient } from "@prisma/client";
import config from "./config";
import { queueRequest } from "./execution";
import InteractionManager from "./interactionManager";
const discord = new DiscordApi.Client({
intents: [
@ -19,6 +20,9 @@ export const openai = new OpenAIApi(new OpenAIApiConfiguration({
export const database = new PrismaClient();
const interactionManager = new InteractionManager();
interactionManager.bindClient(discord);
discord.on("ready", async event => {
console.log(`Connected to Discord as ${event.user.tag} (${event.user.id})`);
});