mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
don't stop auto-execute on /abort
This commit is contained in:
@ -171,19 +171,23 @@ const init = async () => {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
quickReplyApi = new QuickReplyApi(settings, manager);
|
||||||
|
const slash = new SlashCommandHandler(quickReplyApi);
|
||||||
|
slash.init();
|
||||||
|
|
||||||
if (settings.isEnabled) {
|
if (settings.isEnabled) {
|
||||||
const qrList = [
|
const qrList = [
|
||||||
...settings.config.setList.map(link=>link.set.qrList.filter(qr=>qr.executeOnStartup)).flat(),
|
...settings.config.setList.map(link=>link.set.qrList.filter(qr=>qr.executeOnStartup)).flat(),
|
||||||
...(settings.chatConfig?.setList?.map(link=>link.set.qrList.filter(qr=>qr.executeOnStartup))?.flat() ?? []),
|
...(settings.chatConfig?.setList?.map(link=>link.set.qrList.filter(qr=>qr.executeOnStartup))?.flat() ?? []),
|
||||||
];
|
];
|
||||||
for (const qr of qrList) {
|
for (const qr of qrList) {
|
||||||
await qr.onExecute();
|
try {
|
||||||
|
await qr.onExecute();
|
||||||
|
} catch (ex) {
|
||||||
|
warn(ex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
quickReplyApi = new QuickReplyApi(settings, manager);
|
|
||||||
const slash = new SlashCommandHandler(quickReplyApi);
|
|
||||||
slash.init();
|
|
||||||
};
|
};
|
||||||
eventSource.on(event_types.APP_READY, init);
|
eventSource.on(event_types.APP_READY, init);
|
||||||
|
|
||||||
@ -203,7 +207,11 @@ const onChatChanged = async (chatIdx) => {
|
|||||||
...(settings.chatConfig?.setList?.map(link=>link.set.qrList.filter(qr=>qr.executeOnChatChange))?.flat() ?? []),
|
...(settings.chatConfig?.setList?.map(link=>link.set.qrList.filter(qr=>qr.executeOnChatChange))?.flat() ?? []),
|
||||||
];
|
];
|
||||||
for (const qr of qrList) {
|
for (const qr of qrList) {
|
||||||
await qr.onExecute();
|
try {
|
||||||
|
await qr.onExecute();
|
||||||
|
} catch (ex) {
|
||||||
|
warn(ex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -216,7 +224,11 @@ const onUserMessage = async () => {
|
|||||||
...(settings.chatConfig?.setList?.map(link=>link.set.qrList.filter(qr=>qr.executeOnUser))?.flat() ?? []),
|
...(settings.chatConfig?.setList?.map(link=>link.set.qrList.filter(qr=>qr.executeOnUser))?.flat() ?? []),
|
||||||
];
|
];
|
||||||
for (const qr of qrList) {
|
for (const qr of qrList) {
|
||||||
await qr.onExecute();
|
try {
|
||||||
|
await qr.onExecute();
|
||||||
|
} catch (ex) {
|
||||||
|
warn(ex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -229,7 +241,11 @@ const onAiMessage = async () => {
|
|||||||
...(settings.chatConfig?.setList?.map(link=>link.set.qrList.filter(qr=>qr.executeOnAi))?.flat() ?? []),
|
...(settings.chatConfig?.setList?.map(link=>link.set.qrList.filter(qr=>qr.executeOnAi))?.flat() ?? []),
|
||||||
];
|
];
|
||||||
for (const qr of qrList) {
|
for (const qr of qrList) {
|
||||||
await qr.onExecute();
|
try {
|
||||||
|
await qr.onExecute();
|
||||||
|
} catch (ex) {
|
||||||
|
warn(ex);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user