Explicit message for missing subcommand (#2019)
This commit is contained in:
parent
bf873a1d85
commit
6742a1b7f9
|
@ -477,19 +477,27 @@ export const useSlashCommandProcessor = (
|
||||||
switch (subCommand) {
|
switch (subCommand) {
|
||||||
case 'show':
|
case 'show':
|
||||||
showMemoryAction();
|
showMemoryAction();
|
||||||
return; // Explicitly return void
|
return;
|
||||||
case 'refresh':
|
case 'refresh':
|
||||||
performMemoryRefresh();
|
performMemoryRefresh();
|
||||||
return; // Explicitly return void
|
return;
|
||||||
case 'add':
|
case 'add':
|
||||||
return addMemoryAction(mainCommand, subCommand, args); // Return the object
|
return addMemoryAction(mainCommand, subCommand, args); // Return the object
|
||||||
|
case undefined:
|
||||||
|
addMessage({
|
||||||
|
type: MessageType.ERROR,
|
||||||
|
content:
|
||||||
|
'Missing command\nUsage: /memory <show|refresh|add> [text for add]',
|
||||||
|
timestamp: new Date(),
|
||||||
|
});
|
||||||
|
return;
|
||||||
default:
|
default:
|
||||||
addMessage({
|
addMessage({
|
||||||
type: MessageType.ERROR,
|
type: MessageType.ERROR,
|
||||||
content: `Unknown /memory command: ${subCommand}. Available: show, refresh, add`,
|
content: `Unknown /memory command: ${subCommand}. Available: show, refresh, add`,
|
||||||
timestamp: new Date(),
|
timestamp: new Date(),
|
||||||
});
|
});
|
||||||
return; // Explicitly return void
|
return;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@ -677,6 +685,14 @@ export const useSlashCommandProcessor = (
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
if (!subCommand) {
|
||||||
|
addMessage({
|
||||||
|
type: MessageType.ERROR,
|
||||||
|
content: 'Missing command\nUsage: /chat <list|save|resume> [tag]',
|
||||||
|
timestamp: new Date(),
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
switch (subCommand) {
|
switch (subCommand) {
|
||||||
case 'save': {
|
case 'save': {
|
||||||
const history = chat.getHistory();
|
const history = chat.getHistory();
|
||||||
|
|
Loading…
Reference in New Issue