mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
set active character / active group in /go command
This commit is contained in:
@ -25,6 +25,8 @@ import {
|
|||||||
saveChatConditional,
|
saveChatConditional,
|
||||||
sendMessageAsUser,
|
sendMessageAsUser,
|
||||||
sendSystemMessage,
|
sendSystemMessage,
|
||||||
|
setActiveCharacter,
|
||||||
|
setActiveGroup,
|
||||||
setCharacterId,
|
setCharacterId,
|
||||||
setCharacterName,
|
setCharacterName,
|
||||||
setExtensionPrompt,
|
setExtensionPrompt,
|
||||||
@ -1248,11 +1250,15 @@ async function goToCharacterCallback(_, name) {
|
|||||||
|
|
||||||
if (characterIndex !== -1) {
|
if (characterIndex !== -1) {
|
||||||
await openChat(new String(characterIndex));
|
await openChat(new String(characterIndex));
|
||||||
|
setActiveCharacter(characters[characterIndex]?.avatar);
|
||||||
|
setActiveGroup(null);
|
||||||
return characters[characterIndex]?.name;
|
return characters[characterIndex]?.name;
|
||||||
} else {
|
} else {
|
||||||
const group = groups.find(it => it.name.toLowerCase() == name.toLowerCase());
|
const group = groups.find(it => it.name.toLowerCase() == name.toLowerCase());
|
||||||
if (group) {
|
if (group) {
|
||||||
await openGroupById(group.id);
|
await openGroupById(group.id);
|
||||||
|
setActiveCharacter(null);
|
||||||
|
setActiveGroup(group.id);
|
||||||
return group.name;
|
return group.name;
|
||||||
} else {
|
} else {
|
||||||
console.warn(`No matches found for name "${name}"`);
|
console.warn(`No matches found for name "${name}"`);
|
||||||
|
Reference in New Issue
Block a user