Skip to content

Commit da51b6b

Browse files
fix: corrige processamento de mensagens subsequentes no Evolution Bot
Corrige o problema onde o Evolution Bot não processava mensagens subsequentes após a primeira resposta. A correção permite que o bot continue respondendo a todas as mensagens enquanto a sessão estiver ativa, melhorando a continuidade da conversa.
1 parent 6511148 commit da51b6b

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

src/api/integrations/chatbot/base-chatbot.controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -876,7 +876,7 @@ export abstract class BaseChatbotController<BotType = any, BotData extends BaseC
876876
}
877877

878878
// Skip if session exists but not awaiting user input
879-
if (session && !session.awaitUser) {
879+
if (session && session.status === 'closed') {
880880
return;
881881
}
882882

src/api/integrations/chatbot/chatbot.controller.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ export class ChatbotController {
179179
if (session) {
180180
if (session.status !== 'closed' && !session.botId) {
181181
this.logger.warn('Session is already opened in another integration');
182-
return;
182+
return null;
183183
} else if (!session.botId) {
184184
session = null;
185185
}

src/api/integrations/chatbot/evolutionBot/controllers/evolutionBot.controller.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ export class EvolutionBotController extends BaseChatbotController<EvolutionBot,
8989
settings: any,
9090
content: string,
9191
pushName?: string,
92+
msg?: any,
9293
) {
93-
await this.evolutionBotService.process(instance, remoteJid, bot, session, settings, content, pushName);
94+
await this.evolutionBotService.process(instance, remoteJid, bot, session, settings, content, pushName, msg);
9495
}
9596
}

0 commit comments

Comments
 (0)