meshai/meshai/commands/clear.py
Ubuntu 8001de46c7 Add !clear command and simplify !reset confirmation message
Both !clear and !reset now respond with "Conversation memory cleared."

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 07:24:02 +00:00

17 lines
585 B
Python

"""Clear command handler (alias for !reset)."""
from .base import CommandContext, CommandHandler
class ClearCommand(CommandHandler):
"""Clear conversation history and summary."""
name = "clear"
description = "Clear your chat history"
usage = "!clear"
async def execute(self, args: str, context: CommandContext) -> str:
"""Clear conversation history and summary for the sender."""
await context.history.clear_history(context.sender_id)
await context.history.clear_summary(context.sender_id)
return "Conversation memory cleared."