mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-02-22 23:18:27 +01:00
#778 Slash command to add a persona message without generation
This commit is contained in:
parent
1055673865
commit
5c66c34414
@ -20,6 +20,7 @@ import {
|
||||
setCharacterId,
|
||||
generateQuietPrompt,
|
||||
reloadCurrentChat,
|
||||
sendMessageAsUser,
|
||||
} from "../script.js";
|
||||
import { humanizedDateTime } from "./RossAscends-mods.js";
|
||||
import { resetSelectedGroup } from "./group-chats.js";
|
||||
@ -126,11 +127,23 @@ parser.addCommand('continue', continueChatCallback, ['cont'], ' – continues th
|
||||
parser.addCommand('go', goToCharacterCallback, ['char'], '<span class="monospace">(name)</span> – opens up a chat with the character by its name', true, true);
|
||||
parser.addCommand('sysgen', generateSystemMessage, [], '<span class="monospace">(prompt)</span> – generates a system message using a specified prompt', true, true);
|
||||
parser.addCommand('delname', deleteMessagesByNameCallback, ['cancel'], '<span class="monospace">(name)</span> – deletes all messages attributed to a specified name', true, true);
|
||||
parser.addCommand('send', sendUserMessageCallback, ['add'], '<span class="monospace">(text)</span> – adds a user message to the chat log without triggering a generation', true, true);
|
||||
|
||||
const NARRATOR_NAME_KEY = 'narrator_name';
|
||||
const NARRATOR_NAME_DEFAULT = 'System';
|
||||
const COMMENT_NAME_DEFAULT = 'Note';
|
||||
|
||||
async function sendUserMessageCallback(_, text) {
|
||||
if (!text) {
|
||||
console.warn('WARN: No text provided for /send command');
|
||||
return;
|
||||
}
|
||||
|
||||
text = text.trim();
|
||||
const bias = extractMessageBias(text);
|
||||
sendMessageAsUser(text, bias);
|
||||
}
|
||||
|
||||
async function deleteMessagesByNameCallback(_, name) {
|
||||
if (!name) {
|
||||
console.warn('WARN: No name provided for /delname command');
|
||||
|
Loading…
x
Reference in New Issue
Block a user