Files
Quetza/modules/ai/commands/askclear.ts
T
deytenit 534cd72444 feat: Add AI module
ollama based ai module for more bot entertaiment
2025-06-13 14:42:08 +03:00

36 lines
949 B
TypeScript

/**
* /askclear
*
* Clears the conversation history for the current user in the current guild.
*/
import { ChatInputCommandInteraction, SlashCommandBuilder } from "discord.js";
import Client from "$lib/client.js";
import logger from "$lib/logger.js";
import AI from "../lib/ai.js";
import replies from "../lib/replies.js";
async function execute(
_: Client,
interaction: ChatInputCommandInteraction,
controller: AI
): Promise<void> {
if (!interaction.isChatInputCommand() || !interaction.inCachedGuild()) {
logger.warn("Interaction rejected.", { interaction });
return;
}
controller.clearConversation(interaction.guildId, interaction.user.id);
await interaction.reply(replies.historyCleared());
}
const data = new SlashCommandBuilder()
.setName("askclear")
.setDescription("Clear your conversation history with the AI assistant")
.setDMPermission(false);
export { data, execute };