Implemented /getglobalbooks STScript command

This commit is contained in:
Teashrock
2025-04-18 09:41:57 +03:00
parent 8f63edfd30
commit e3f5949cc1

View File

@@ -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,