mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Slash command to send a "neutral" message
This commit is contained in:
@ -236,7 +236,7 @@ let characters = [];
|
||||
let this_chid;
|
||||
let backgrounds = [];
|
||||
const default_avatar = "img/ai4.png";
|
||||
const system_avatar = "img/five.png";
|
||||
export const system_avatar = "img/five.png";
|
||||
export let CLIENT_VERSION = 'SillyTavern:UNKNOWN:Cohee#1207'; // For Horde header
|
||||
let is_colab = false;
|
||||
let is_checked_colab = false;
|
||||
|
@ -1,7 +1,11 @@
|
||||
import {
|
||||
addOneMessage,
|
||||
chat,
|
||||
sendSystemMessage,
|
||||
system_avatar,
|
||||
system_message_types
|
||||
} from "../script.js";
|
||||
import { humanizedDateTime } from "./RossAscends-mods.js";
|
||||
export {
|
||||
executeSlashCommands,
|
||||
registerSlashCommand,
|
||||
@ -75,6 +79,28 @@ const getSlashCommandsHelp = parser.getHelpString.bind(parser);
|
||||
|
||||
parser.addCommand('help', helpCommandCallback, ['?'], ' – displays this help message', true, true);
|
||||
parser.addCommand('bg', setBackgroundCallback, ['background'], '<span class="monospace">(filename)</span> – sets a background according to filename, partial names allowed, will set the first one alphebetically if multiple files begin with the provided argument string', false, true);
|
||||
parser.addCommand('sys', sendNarratorMessage, [], ' - sends message as a narrator character', false, true);
|
||||
|
||||
function sendNarratorMessage(_, text) {
|
||||
if (!text) {
|
||||
return;
|
||||
}
|
||||
|
||||
const message = {
|
||||
extra: {},
|
||||
name: 'Narrator',
|
||||
is_user: false,
|
||||
is_name: false,
|
||||
is_system: false,
|
||||
send_date: humanizedDateTime(),
|
||||
mes: text.trim(),
|
||||
force_avatar: system_avatar,
|
||||
type
|
||||
};
|
||||
|
||||
chat.push(message);
|
||||
addOneMessage(message);
|
||||
}
|
||||
|
||||
function helpCommandCallback() {
|
||||
sendSystemMessage(system_message_types.HELP);
|
||||
|
Reference in New Issue
Block a user