fix: 'previous_chat_log' cbs (#801)

# PR Checklist
- [ ] Have you checked if it works normally in all models? *Ignore this
if it doesn't use models.*
- [ ] Have you checked if it works normally in all web, local, and node
hosted versions? If it doesn't, have you blocked it in those versions?
- [ ] Have you added type definitions?

# Description
It appears that the `previous_chat_log` cbs currently behaves
differently than described in the documentation.

Thank you for your time.
This commit is contained in:
kwaroran
2025-04-02 21:24:41 +09:00
committed by GitHub
2 changed files with 2 additions and 2 deletions

View File

@@ -56,7 +56,7 @@
<button class={(DBState.db.enabledModules.includes(rmodule.id)) ?
"mr-2 cursor-pointer text-blue-500" :
rmodule.namespace &&
DBState.db.moduleIntergration.split(',').map((s) => s.trim()).includes(rmodule.namespace) ?
DBState.db.moduleIntergration?.split(',').map((s) => s.trim()).includes(rmodule.namespace) ?
"text-amber-500 hover:text-green-500 mr-2 cursor-pointer" :
"text-textcolor2 hover:text-green-500 mr-2 cursor-pointer"
} use:tooltip={language.enableGlobal} onclick={async (e) => {

View File

@@ -1379,7 +1379,7 @@ function basicMatcher (p1:string,matcherArg:matcherArg,vars:{[key:string]:string
case 'previous_chat_log':{
const selchar = db.characters[get(selectedCharID)]
const chat = selchar?.chats?.[selchar.chatPage]
return chat?.message[chatID - 1]?.data ?? 'Out of range'
return chat?.message[Number(arra[1])]?.data ?? 'Out of range'
}
case 'tonumber':{