mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Bypass generation for QR slash commands
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import { saveSettingsDebounced, callPopup, getRequestHeaders, substituteParams } from "../../../script.js";
|
import { saveSettingsDebounced, callPopup, getRequestHeaders, substituteParams } from "../../../script.js";
|
||||||
import { getContext, extension_settings } from "../../extensions.js";
|
import { getContext, extension_settings } from "../../extensions.js";
|
||||||
import { initScrollHeight, resetScrollHeight } from "../../utils.js";
|
import { initScrollHeight, resetScrollHeight } from "../../utils.js";
|
||||||
import { registerSlashCommand } from "../../slash-commands.js";
|
import { executeSlashCommands, registerSlashCommand } from "../../slash-commands.js";
|
||||||
|
|
||||||
export { MODULE_NAME };
|
export { MODULE_NAME };
|
||||||
|
|
||||||
@@ -152,14 +152,19 @@ async function sendQuickReply(index) {
|
|||||||
|
|
||||||
newText = substituteParams(newText);
|
newText = substituteParams(newText);
|
||||||
|
|
||||||
|
// the prompt starts with '/' - execute slash commands natively
|
||||||
|
if (prompt.startsWith('/')) {
|
||||||
|
await executeSlashCommands(newText);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$("#send_textarea").val(newText);
|
$("#send_textarea").val(newText);
|
||||||
|
|
||||||
// Set the focus back to the textarea
|
// Set the focus back to the textarea
|
||||||
$("#send_textarea").trigger('focus');
|
$("#send_textarea").trigger('focus');
|
||||||
|
|
||||||
// Only trigger send button if quickActionEnabled is not checked or
|
// Only trigger send button if quickActionEnabled is not checked or
|
||||||
// the prompt starts with '/'
|
if (!extension_settings.quickReply.quickActionEnabled) {
|
||||||
if (!extension_settings.quickReply.quickActionEnabled || prompt.startsWith('/')) {
|
|
||||||
$("#send_but").trigger('click');
|
$("#send_but").trigger('click');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user