Fix issues
This commit is contained in:
14
dist/commands/resetmemory.js
vendored
Normal file
14
dist/commands/resetmemory.js
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
import { SlashCommandBuilder } from 'discord.js';
|
||||
import { withConn } from '../db/pool.js';
|
||||
export const data = new SlashCommandBuilder()
|
||||
.setName('resetmemory')
|
||||
.setDescription('Reset your AI chat memory (only affects you)');
|
||||
export async function execute(interaction) {
|
||||
if (!interaction.guildId)
|
||||
return interaction.reply({ content: 'Guild only command.', ephemeral: true });
|
||||
const target = interaction.user;
|
||||
await withConn(async (conn) => {
|
||||
await conn.query('DELETE FROM user_ai_memory WHERE guild_id = ? AND user_id = ?', [interaction.guildId, target.id]);
|
||||
});
|
||||
await interaction.reply({ content: 'Your AI memory has been fully reset.', ephemeral: true });
|
||||
}
|
||||
Reference in New Issue
Block a user