allow /run for quick replies from other presets

/run otherPresetName.quickReplyLabel
This commit is contained in:
LenAnderson 2023-12-09 17:20:15 +00:00
parent 6f610204d6
commit d00861d913
1 changed files with 9 additions and 1 deletions

View File

@ -241,7 +241,15 @@ async function executeQuickReplyByName(name) {
throw new Error('Quick Reply is disabled'); 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) { if (!qr) {
throw new Error(`Quick Reply "${name}" not found`); throw new Error(`Quick Reply "${name}" not found`);