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