Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 9 additions & 13 deletions src/commands/ai/resetctx.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,18 @@ import { resetContext } from "../../utils/context.ts";

export default {
name: "resetctx",
description: "Reset conversation context for a user",
description: "Reset your conversation context",
aliases: ["resetcontext", "clearctx", "resetai"],
async execute({ message, args }: CommandCallbackOpts) {
async execute({ message }: CommandCallbackOpts) {
if (message.author.bot) return;

const targetUser = message.mentions.users.first() || message.author;
const userId = targetUser.id;

resetContext(userId);

if (targetUser.id === message.author.id) {
await message.reply("Your conversation context has been reset.");
} else {
await message.reply(
`Conversation context for <@${targetUser.id}> has been reset.`,
);
const mentioned = message.mentions.users.first();
if (mentioned && mentioned.id !== message.author.id) {
await message.reply("You can only reset your own context.");
return;
}

Comment on lines +11 to +16

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ion think this part is necessary but informative ig

resetContext(message.author.id);
await message.reply("Your conversation context has been reset.");
},
};
Loading