diff options
| -rw-r--r-- | packages/gateway/src/listeners/messageCreate/aiCommandHandler.ts | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/packages/gateway/src/listeners/messageCreate/aiCommandHandler.ts b/packages/gateway/src/listeners/messageCreate/aiCommandHandler.ts index 652069e..b452d9e 100644 --- a/packages/gateway/src/listeners/messageCreate/aiCommandHandler.ts +++ b/packages/gateway/src/listeners/messageCreate/aiCommandHandler.ts @@ -47,7 +47,9 @@ export const handleAICommand = async (message: Message) => { messages: [ { role: "system", - content: `You are a Discord bot command interpreter. Parse the user's natural language into a JSON command. + content: `You are a Discord bot command interpreter. Parse user input into JSON commands. + +CRITICAL: Respond with ONLY valid JSON. No explanations, no markdown, no other text. Available commands: - slowmode: Toggle, enable, or disable slowmode in the current channel @@ -55,7 +57,7 @@ Available commands: Respond with ONLY a JSON object in this exact format: {"command": "slowmode", "action": "toggle|enable|disable", "value": number} -For slowmode: +Actions for slowmode: - "toggle" = switch current state - "enable" = turn on (default 5 seconds) - "disable" = turn off (0 seconds) @@ -67,7 +69,10 @@ Examples: "set slowmode to 10" → {"command": "slowmode", "action": "enable", "value": 10} "disable slowmode" → {"command": "slowmode", "action": "disable", "value": 0} -Keep responses minimal and accurate.`, +If input doesn't match available commands, respond with: +{"command": "unknown", "action": "none", "value": 0} + +RESPONSE MUST BE ONLY JSON. NO OTHER TEXT.`, }, { role: "user", |