diff --git a/public/script.js b/public/script.js
index 2a727eb32..ff21505ee 100644
--- a/public/script.js
+++ b/public/script.js
@@ -318,6 +318,9 @@ const system_message_types = {
BOOKMARK_BACK: "bookmark_back",
NARRATOR: "narrator",
COMMENT: "comment",
+ SLASH_COMMANDS: "slash_commands",
+ FORMATTING: "formatting",
+ HOTKEYS: "hotkeys",
};
const extension_prompt_types = {
@@ -333,12 +336,31 @@ const system_messages = {
is_system: true,
is_name: true,
mes: [
- `Hi there! The following chat formatting commands are supported:
+ `Hello there! Please select the help topic you would like to learn more about:
- - {{text}} - sets a one-time behavioral bias for the AI. Resets when you send the next message.
-
+ - Slash Commands (or /help slash)
+ - Formatting (or /help format)
+ - Hotkeys (or /help hotkeys)
- Hotkeys/Keybinds:
+
Still got questions left? The Official SillyTavern Documentation Website has much more information!`
+ ]
+ },
+ slash_commands: {
+ name: systemUserName,
+ force_avatar: system_avatar,
+ is_user: false,
+ is_system: true,
+ is_name: true,
+ mes: '',
+ },
+ hotkeys: {
+ name: systemUserName,
+ force_avatar: system_avatar,
+ is_user: false,
+ is_system: true,
+ is_name: true,
+ mes: [
+ `Hotkeys/Keybinds:
- Up = Edit last message in chat
- Ctrl+Up = Edit last USER message in chat
@@ -350,7 +372,26 @@ const system_messages = {
- Escape = stop AI response generation
- Ctrl+Shift+Up = Scroll to context line
- Ctrl+Shift+Down = Scroll chat to bottom
-
+
`
+ ]
+ },
+ formatting: {
+ name: systemUserName,
+ force_avatar: system_avatar,
+ is_user: false,
+ is_system: true,
+ is_name: true,
+ mes: [
+ `Text formatting commands:
+
+ - {{text}} - sets a one-time behavioral bias for the AI. Resets when you send the next message.
+ - *text* - displays as italics
+ - **text** - displays as bold
+ - ***text*** - displays as bold italics
+ - ` + "```" + `text` + "```" + ` - displays as a code block
+ - ` + "`" + `text` + "`" + ` - displays as inline code
+ - $$ text $$ - renders a LaTeX formula (if enabled)
+ - $ text $ - renders an AsciiMath formula (if enabled)
`
]
},
@@ -1525,9 +1566,8 @@ function sendSystemMessage(type, text, extra = {}) {
newMessage.mes = text;
}
- if (type == system_message_types.HELP) {
- newMessage.mes += getSlashCommandsHelp();
- newMessage.mes += `
Still got questions left? The Official SillyTavern Documentation Website has much more information!`;
+ if (type == system_message_types.SLASH_COMMANDS) {
+ newMessage.mes = getSlashCommandsHelp();
}
if (!newMessage.extra) {
diff --git a/public/scripts/slash-commands.js b/public/scripts/slash-commands.js
index b29cb3239..fd3d2123a 100644
--- a/public/scripts/slash-commands.js
+++ b/public/scripts/slash-commands.js
@@ -319,10 +319,28 @@ async function sendCommentMessage(_, text) {
saveChatConditional();
}
-function helpCommandCallback() {
- sendSystemMessage(system_message_types.HELP);
+function helpCommandCallback(_, type) {
+ switch (type?.trim()) {
+ case 'slash':
+ case '1':
+ sendSystemMessage(system_message_types.SLASH_COMMANDS);
+ break;
+ case 'format':
+ case '2':
+ sendSystemMessage(system_message_types.FORMATTING);
+ break;
+ case 'hotkeys':
+ case '3':
+ sendSystemMessage(system_message_types.HOTKEYS);
+ break;
+ default:
+ sendSystemMessage(system_message_types.HELP);
+ break;
+ }
}
+window['displayHelp'] = (page) => helpCommandCallback(null, page);
+
function setBackgroundCallback(_, bg) {
if (!bg) {
return;