mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2024-12-12 09:26:33 +01:00
Set active character for /random
This commit is contained in:
parent
90e66e7782
commit
4e7cd6d63b
@ -21,6 +21,8 @@ import {
|
||||
saveChatConditional,
|
||||
setAnimationDuration,
|
||||
ANIMATION_DURATION_DEFAULT,
|
||||
setActiveGroup,
|
||||
setActiveCharacter,
|
||||
} from '../script.js';
|
||||
import { isMobile, initMovingUI, favsToHotswap } from './RossAscends-mods.js';
|
||||
import {
|
||||
@ -2302,6 +2304,8 @@ async function doRandomChat() {
|
||||
resetSelectedGroup();
|
||||
const characterId = Math.floor(Math.random() * characters.length).toString();
|
||||
setCharacterId(characterId);
|
||||
setActiveCharacter(characters[characterId]?.avatar);
|
||||
setActiveGroup(null);
|
||||
await delay(1);
|
||||
await reloadCurrentChat();
|
||||
return characters[characterId]?.name;
|
||||
|
Loading…
Reference in New Issue
Block a user