From e58360a4b4e960e644fec283c3c1b947a36b9e9f Mon Sep 17 00:00:00 2001 From: Sanskar Tiwari Date: Sun, 21 May 2023 02:03:09 +0530 Subject: [PATCH] subsitute user and char variable in world info keywords --- public/scripts/world-info.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/public/scripts/world-info.js b/public/scripts/world-info.js index 1ec51b112..89e16be83 100644 --- a/public/scripts/world-info.js +++ b/public/scripts/world-info.js @@ -506,16 +506,18 @@ function checkWorldInfo(chat) { if (Array.isArray(entry.key) && entry.key.length) { primary: for (let key of entry.key) { - if (key && textToScan.includes(key.trim().toLowerCase())) { + const substituted = substituteParams(key); + if (substituted && textToScan.includes(substituted.trim().toLowerCase())) { if ( entry.selective && Array.isArray(entry.keysecondary) && entry.keysecondary.length ) { secondary: for (let keysecondary of entry.keysecondary) { + const secondarySubstituted = substituteParams(keysecondary); if ( - keysecondary && - textToScan.includes(keysecondary.trim().toLowerCase()) + secondarySubstituted && + textToScan.includes(secondarySubstituted.trim().toLowerCase()) ) { activatedNow.add(entry.uid); break secondary; @@ -685,4 +687,4 @@ $(document).ready(() => { world_info_recursive = !!$(this).prop('checked'); saveSettingsDebounced(); }) -}); \ No newline at end of file +});