mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
Move macros replacement to script execution time
This commit is contained in:
@ -229,14 +229,14 @@ async function performQuickReply(prompt, index) {
|
||||
newText = `${prompt} `;
|
||||
}
|
||||
|
||||
newText = substituteParams(newText);
|
||||
|
||||
// the prompt starts with '/' - execute slash commands natively
|
||||
if (prompt.startsWith('/')) {
|
||||
await executeSlashCommands(newText);
|
||||
return;
|
||||
}
|
||||
|
||||
newText = substituteParams(newText);
|
||||
|
||||
$("#send_textarea").val(newText);
|
||||
|
||||
// Set the focus back to the textarea
|
||||
@ -560,20 +560,26 @@ function saveQROrder() {
|
||||
});
|
||||
}
|
||||
|
||||
async function onMessageReceived() {
|
||||
async function onMessageReceived(index) {
|
||||
for (let i = 0; i < extension_settings.quickReply.numberOfSlots; i++) {
|
||||
const qr = extension_settings.quickReply.quickReplySlots[i];
|
||||
if (qr?.autoExecute_botMessage) {
|
||||
await sendQuickReply(i);
|
||||
const message = getContext().chat[index];
|
||||
if (message?.mes && message?.mes !== '...') {
|
||||
await sendQuickReply(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
async function onMessageSent() {
|
||||
async function onMessageSent(index) {
|
||||
for (let i = 0; i < extension_settings.quickReply.numberOfSlots; i++) {
|
||||
const qr = extension_settings.quickReply.quickReplySlots[i];
|
||||
if (qr?.autoExecute_userMessage) {
|
||||
await sendQuickReply(i);
|
||||
const message = getContext().chat[index];
|
||||
if (message?.mes && message?.mes !== '...') {
|
||||
await sendQuickReply(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user