mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Implemented /getglobalbooks STScript command
This commit is contained in:
@@ -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,
|
||||
|
Reference in New Issue
Block a user