mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Add random slash command
This commit is contained in:
@ -172,6 +172,7 @@ export {
|
|||||||
select_rm_info,
|
select_rm_info,
|
||||||
setCharacterId,
|
setCharacterId,
|
||||||
setCharacterName,
|
setCharacterName,
|
||||||
|
replaceCurrentChat,
|
||||||
setOnlineStatus,
|
setOnlineStatus,
|
||||||
checkOnlineStatus,
|
checkOnlineStatus,
|
||||||
setEditedMessageId,
|
setEditedMessageId,
|
||||||
|
@ -14,6 +14,8 @@ import {
|
|||||||
getCurrentChatId,
|
getCurrentChatId,
|
||||||
name1,
|
name1,
|
||||||
name2,
|
name2,
|
||||||
|
replaceCurrentChat,
|
||||||
|
setCharacterId
|
||||||
} from "../script.js";
|
} from "../script.js";
|
||||||
import { favsToHotswap } from "./RossAscends-mods.js";
|
import { favsToHotswap } from "./RossAscends-mods.js";
|
||||||
import {
|
import {
|
||||||
@ -929,6 +931,14 @@ function doNewChat() {
|
|||||||
}, 1);
|
}, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function doRandomChat() {
|
||||||
|
setCharacterId(Math.floor(Math.random() * characters.length));
|
||||||
|
setTimeout(() => {
|
||||||
|
replaceCurrentChat();
|
||||||
|
}, 1);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
function doDelMode() {
|
function doDelMode() {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
$("#option_delete_mes").trigger('click')
|
$("#option_delete_mes").trigger('click')
|
||||||
@ -1326,5 +1336,6 @@ $(document).ready(() => {
|
|||||||
|
|
||||||
registerSlashCommand('vn', toggleWaifu, ['vn'], ' – swaps Visual Novel Mode On/Off', false, true);
|
registerSlashCommand('vn', toggleWaifu, ['vn'], ' – swaps Visual Novel Mode On/Off', false, true);
|
||||||
registerSlashCommand('newchat', doNewChat, ['newchat'], ' – start a new chat with current character', true, true);
|
registerSlashCommand('newchat', doNewChat, ['newchat'], ' – start a new chat with current character', true, true);
|
||||||
|
registerSlashCommand('random', doRandomChat, ['random'], ' – start a new chat with a random character', true, true);
|
||||||
registerSlashCommand('delmode', doDelMode, ['delmode'], ' – enter message deletion mode', true, true);
|
registerSlashCommand('delmode', doDelMode, ['delmode'], ' – enter message deletion mode', true, true);
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user