slight update to input processing

This commit is contained in:
2025-08-03 14:24:50 +00:00
parent 150e2d638e
commit 2f3d16dbc5
3 changed files with 30 additions and 12 deletions

View File

@ -4,9 +4,18 @@ import { envConfig } from "./main.js";
import { Notification } from "../types.js";
const trimInputData = (input: string): string => {
const strippedInput = striptags(input);
const strippedInput = striptags(input, [], "\n");
const split = strippedInput.split(" ");
const promptStringIndex = split.indexOf("!prompt");
const botFqnIndex = split.indexOf("@nice-ai");
const botFqnIndexFull = split.indexOf("@nice-ai@nicecrew.digital");
if (botFqnIndex !== -1) {
split[botFqnIndex] = "Lexi";
}
if (botFqnIndexFull !== -1) {
split[botFqnIndexFull] = "Lexi";
}
split.splice(promptStringIndex, 1);
return split.join(" "); // returns everything after the !prompt
};