diff --git a/public/scripts/extensions/quick-reply/api/QuickReplyApi.js b/public/scripts/extensions/quick-reply/api/QuickReplyApi.js
index 6565ff3bb..926003634 100644
--- a/public/scripts/extensions/quick-reply/api/QuickReplyApi.js
+++ b/public/scripts/extensions/quick-reply/api/QuickReplyApi.js
@@ -202,6 +202,7 @@ export class QuickReplyApi {
* @param {boolean} [props.executeOnChatChange] whether to execute the quick reply when a new chat is loaded
* @param {boolean} [props.executeOnGroupMemberDraft] whether to execute the quick reply when a group member is selected
* @param {boolean} [props.executeOnNewChat] whether to execute the quick reply when a new chat is created
+ * @param {boolean} [props.executeBeforeGeneration] whether to execute the quick reply before message generation
* @param {string} [props.automationId] when not empty, the quick reply will be executed when the WI with the given automation ID is activated
* @returns {QuickReply} the new quick reply
*/
@@ -217,6 +218,7 @@ export class QuickReplyApi {
executeOnChatChange,
executeOnGroupMemberDraft,
executeOnNewChat,
+ executeBeforeGeneration,
automationId,
} = {}) {
const set = this.getSetByName(setName);
@@ -236,6 +238,7 @@ export class QuickReplyApi {
qr.executeOnChatChange = executeOnChatChange ?? false;
qr.executeOnGroupMemberDraft = executeOnGroupMemberDraft ?? false;
qr.executeOnNewChat = executeOnNewChat ?? false;
+ qr.executeBeforeGeneration = executeBeforeGeneration ?? false;
qr.automationId = automationId ?? '';
qr.onUpdate();
return qr;
@@ -259,6 +262,7 @@ export class QuickReplyApi {
* @param {boolean} [props.executeOnChatChange] whether to execute the quick reply when a new chat is loaded
* @param {boolean} [props.executeOnGroupMemberDraft] whether to execute the quick reply when a group member is selected
* @param {boolean} [props.executeOnNewChat] whether to execute the quick reply when a new chat is created
+ * @param {boolean} [props.executeBeforeGeneration] whether to execute the quick reply before message generation
* @param {string} [props.automationId] when not empty, the quick reply will be executed when the WI with the given automation ID is activated
* @returns {QuickReply} the altered quick reply
*/
@@ -275,6 +279,7 @@ export class QuickReplyApi {
executeOnChatChange,
executeOnGroupMemberDraft,
executeOnNewChat,
+ executeBeforeGeneration,
automationId,
} = {}) {
const qr = this.getQrByLabel(setName, label);
@@ -293,6 +298,7 @@ export class QuickReplyApi {
qr.executeOnChatChange = executeOnChatChange ?? qr.executeOnChatChange;
qr.executeOnGroupMemberDraft = executeOnGroupMemberDraft ?? qr.executeOnGroupMemberDraft;
qr.executeOnNewChat = executeOnNewChat ?? qr.executeOnNewChat;
+ qr.executeBeforeGeneration = executeBeforeGeneration ?? qr.executeBeforeGeneration;
qr.automationId = automationId ?? qr.automationId;
qr.onUpdate();
return qr;
diff --git a/public/scripts/extensions/quick-reply/html/qrEditor.html b/public/scripts/extensions/quick-reply/html/qrEditor.html
index e81a11ba2..6fc47b573 100644
--- a/public/scripts/extensions/quick-reply/html/qrEditor.html
+++ b/public/scripts/extensions/quick-reply/html/qrEditor.html
@@ -116,6 +116,10 @@
Execute on group member draft
+