Skip to content

Commit

Permalink
trigger chat stopper with name even without colon
Browse files Browse the repository at this point in the history
  • Loading branch information
Concedo authored and Concedo committed Jul 23, 2023
1 parent ed3cf57 commit bcf98c5
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -6717,9 +6726,6 @@
}
}
}
else {
splitresponse = gentxt.split(localsettings.chatname + "\:");
}

let startpart = splitresponse[0];
if (startpart.length > 0 && startpart[startpart.length - 1] == "\n") {
Expand Down

0 comments on commit bcf98c5

Please sign in to comment.