Quick Replies: Add auto-execute on new chat

This commit is contained in:
Cohee
2024-08-14 00:08:16 +03:00
parent 78bee4631d
commit 06d300ad36
5 changed files with 33 additions and 0 deletions

View File

@ -83,6 +83,15 @@ export class AutoExecuteHandler {
await this.performAutoExecute(qrList);
}
async handleNewChat() {
if (!this.checkExecute()) return;
const qrList = [
...this.settings.config.setList.map(link=>link.set.qrList.filter(qr=>qr.executeOnNewChat)).flat(),
...(this.settings.chatConfig?.setList?.map(link=>link.set.qrList.filter(qr=>qr.executeOnNewChat))?.flat() ?? []),
];
await this.performAutoExecute(qrList);
}
/**
* @param {any[]} entries Set of activated entries
*/