From bcf98c59f532c1fa498a4ece54b646f6f49c1ac4 Mon Sep 17 00:00:00 2001 From: Concedo Date: Sun, 23 Jul 2023 16:53:30 +0800 Subject: [PATCH] trigger chat stopper with name even without colon --- index.html | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index 0c49818..997a45f 100644 --- a/index.html +++ b/index.html @@ -6697,8 +6697,17 @@ //if we are in chatmode, truncate to my first response if (localsettings.opmode == 3) { let foundMyName = gentxt.indexOf(localsettings.chatname + "\:"); + let foundMyName2 = gentxt.indexOf("\n"+localsettings.chatname+" "); let splitresponse = []; - if (foundMyName == -1) //if no name found + if (foundMyName != -1) + { + splitresponse = gentxt.split(localsettings.chatname + "\:"); + } + else if (foundMyName2 != -1) //added by henky request, trigger even without colon + { + splitresponse = gentxt.split("\n"+localsettings.chatname+" "); + } + else //if no name found { if(localsettings.multiline_replies) { @@ -6717,9 +6726,6 @@ } } } - else { - splitresponse = gentxt.split(localsettings.chatname + "\:"); - } let startpart = splitresponse[0]; if (startpart.length > 0 && startpart[startpart.length - 1] == "\n") {