Extend case for chat index and role (#577)
# PR Checklist
- [ ] Did you check if it works normally in all models? *ignore this
when it dosen't uses models*
- [ ] Did you check if it works normally in all of web, local and node
hosted versions? if it dosen't, did you blocked it in those versions?
- [ ] Did you added a type def?
# Description
With the recent increased utilization of custom styles, I've modified
the '{{chat_index}}' and '{{roll}}' cbs to cover a bit more cases.
Please review them to see if they meet your vision.

This commit is contained in:
@@ -926,6 +926,10 @@ function basicMatcher (p1:string,matcherArg:matcherArg,vars:{[key:string]:string
|
|||||||
return db.subModel
|
return db.subModel
|
||||||
}
|
}
|
||||||
case 'role': {
|
case 'role': {
|
||||||
|
if (chatID !== -1) {
|
||||||
|
const selchar = db.characters[get(selectedCharID)]
|
||||||
|
return selchar.chats[selchar.chatPage].message[chatID].role;
|
||||||
|
}
|
||||||
return matcherArg.role ?? 'role'
|
return matcherArg.role ?? 'role'
|
||||||
}
|
}
|
||||||
case 'jbtoggled':{
|
case 'jbtoggled':{
|
||||||
|
|||||||
@@ -197,7 +197,7 @@ export async function processScriptFull(char:character|groupChat|simpleCharacter
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
data = risuChatParser(data.replace(reg, outScript))
|
data = risuChatParser(data.replace(reg, outScript), { chatID: chatID })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user