mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
throw exception from QRs window-function if no match
This commit is contained in:
@@ -183,14 +183,16 @@ const init = async () => {
|
|||||||
;
|
;
|
||||||
if (!qr) {
|
if (!qr) {
|
||||||
let [setName, ...qrName] = name.split('.');
|
let [setName, ...qrName] = name.split('.');
|
||||||
name = qrName.join('.');
|
qrName = qrName.join('.');
|
||||||
let qrs = QuickReplySet.get(setName);
|
let qrs = QuickReplySet.get(setName);
|
||||||
if (qrs) {
|
if (qrs) {
|
||||||
qr = qrs.qrList.find(it=>it.label == name);
|
qr = qrs.qrList.find(it=>it.label == qrName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (qr && qr.onExecute) {
|
if (qr && qr.onExecute) {
|
||||||
return await qr.execute(args);
|
return await qr.execute(args);
|
||||||
|
} else {
|
||||||
|
throw new Error(`No Quick Reply found for "${name}".`);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user