mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-03-10 00:50:11 +01:00
Merge pull request #1499 from LenAnderson/qr-execute-from-any-preset
Allow /run for quick replies from any preset
This commit is contained in:
commit
2d7811fa46
@ -241,7 +241,15 @@ async function executeQuickReplyByName(name) {
|
||||
throw new Error('Quick Reply is disabled');
|
||||
}
|
||||
|
||||
const qr = extension_settings.quickReply.quickReplySlots.find(x => x.label == name);
|
||||
let qr = extension_settings.quickReply.quickReplySlots.find(x => x.label == name);
|
||||
|
||||
if (!qr && name.includes('.')) {
|
||||
const [presetName, qrName] = name.split('.');
|
||||
const preset = presets.find(x => x.name == presetName);
|
||||
if (preset) {
|
||||
qr = preset.quickReplySlots.find(x => x.label == qrName);
|
||||
}
|
||||
}
|
||||
|
||||
if (!qr) {
|
||||
throw new Error(`Quick Reply "${name}" not found`);
|
||||
|
Loading…
x
Reference in New Issue
Block a user