mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2025-03-15 22:52:23 +00:00
match user prompts exactly not partially (#2245)
This commit is contained in:
parent
9aa77dfb8d
commit
cf6928fd5d
1 changed files with 4 additions and 1 deletions
|
@ -25,7 +25,10 @@ async function grepCommand(message, user = null) {
|
|||
// Allows multiple commands in one message
|
||||
let updatedMessage = message;
|
||||
for (const preset of userPresets) {
|
||||
const regex = new RegExp(preset.command, "g");
|
||||
const regex = new RegExp(
|
||||
`(?:\\b\\s|^)(${preset.command})(?:\\b\\s|$)`,
|
||||
"g"
|
||||
);
|
||||
updatedMessage = updatedMessage.replace(regex, preset.prompt);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue