From 247c39fe39a4c255ecd8e333db9b9ae6a3328297 Mon Sep 17 00:00:00 2001 From: Ygor Santana Date: Sat, 22 Feb 2025 14:16:08 -0300 Subject: [PATCH 1/2] fix: expiration time being useless when not awaitUser --- .../chatbot/typebot/controllers/typebot.controller.ts | 6 +----- .../chatbot/typebot/services/typebot.service.ts | 4 ++++ 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/api/integrations/chatbot/typebot/controllers/typebot.controller.ts b/src/api/integrations/chatbot/typebot/controllers/typebot.controller.ts index 14975234..5b3ea395 100644 --- a/src/api/integrations/chatbot/typebot/controllers/typebot.controller.ts +++ b/src/api/integrations/chatbot/typebot/controllers/typebot.controller.ts @@ -1016,11 +1016,7 @@ export class TypebotController extends ChatbotController implements ChatbotContr if (!listeningFromMe && key.fromMe) { return; - } - - if (session && !session.awaitUser) { - return; - } + } if (debounceTime && debounceTime > 0) { this.processDebounce(this.userMessageDebounce, content, remoteJid, debounceTime, async (debouncedContent) => { diff --git a/src/api/integrations/chatbot/typebot/services/typebot.service.ts b/src/api/integrations/chatbot/typebot/services/typebot.service.ts index f0e4dc7f..94a24f4f 100644 --- a/src/api/integrations/chatbot/typebot/services/typebot.service.ts +++ b/src/api/integrations/chatbot/typebot/services/typebot.service.ts @@ -741,6 +741,10 @@ export class TypebotService { } } + if (session && !session.awaitUser) { + return; + } + if (session && session.status !== 'opened') { return; } From 2f1df734e08e47b9155be95eca9e5fbbb57adb3c Mon Sep 17 00:00:00 2001 From: Ygor Santana Date: Sat, 22 Feb 2025 14:17:37 -0300 Subject: [PATCH 2/2] style: run lint --- .../chatbot/typebot/controllers/typebot.controller.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/integrations/chatbot/typebot/controllers/typebot.controller.ts b/src/api/integrations/chatbot/typebot/controllers/typebot.controller.ts index 5b3ea395..c92fdda3 100644 --- a/src/api/integrations/chatbot/typebot/controllers/typebot.controller.ts +++ b/src/api/integrations/chatbot/typebot/controllers/typebot.controller.ts @@ -1016,7 +1016,7 @@ export class TypebotController extends ChatbotController implements ChatbotContr if (!listeningFromMe && key.fromMe) { return; - } + } if (debounceTime && debounceTime > 0) { this.processDebounce(this.userMessageDebounce, content, remoteJid, debounceTime, async (debouncedContent) => {