You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

25 lines
729 B

import { sendInteractionResponse, SlashCommandOptions } from "@wackford/mod.ts";
import { AIs, checkAI } from "../ai/index.ts";
import { db } from "../database.ts";
export default {
name: "reset",
description: "resets the conversation history of the chatbot",
execute: async (bot, interaction) => {
const channelId = interaction?.channelId?.toString() as string;
const AI = AIs[interaction?.channelId?.toString() as string];
if (!checkAI(bot, interaction, AI)) return;
AI.reset();
db.change(channelId, {
history: []
})
await sendInteractionResponse(bot, interaction, {
content: `Done!`,
});
},
} as SlashCommandOptions;