diff --git a/public/scripts/world-info.js b/public/scripts/world-info.js index c1ff586a3..2871ef9db 100644 --- a/public/scripts/world-info.js +++ b/public/scripts/world-info.js @@ -1338,6 +1338,18 @@ function registerWorldInfoSlashCommands() { } } + async function getGlobalBooksCallback() { + if (!selected_world_info?.length) { + return []; + } + + let entries = selected_world_info.slice(); + + console.debug(`[WI] Selected global world info has ${entries.length} entries`, selected_world_info); + + return entries; + } + SlashCommandParser.addCommandObject(SlashCommand.fromProps({ name: 'world', callback: onWorldInfoChange, @@ -1379,6 +1391,13 @@ function registerWorldInfoSlashCommands() { ], aliases: ['getchatlore', 'getchatwi'], })); + SlashCommandParser.addCommandObject(SlashCommand.fromProps({ + name: 'getglobalbooks', + callback: getGlobalBooksCallback, + returns: 'list of selected lorebook names', + helpString: 'Get a list of names of the selected global lorebooks and pass it down the pipe.', + aliases: ['getgloballore', 'getglobalwi'], + })); SlashCommandParser.addCommandObject(SlashCommand.fromProps({ name: 'getpersonabook', callback: getPersonaBookCallback,