Skip to content

Commit bbf142c

Browse files
fix: corrige comportamento de sessão pausada no Evolution Bot
Corrige o problema onde o Evolution Bot reativava automaticamente por qualquer mensagem do usuario quando a sessão estava pausada. Agora, quando uma sessão está pausada, o bot ignora completamente as mensagens recebidas até que a sessão seja explicitamente reativada.
1 parent da51b6b commit bbf142c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

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

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,16 @@ export abstract class BaseChatbotService<BotType = any, SettingsType = any> {
126126
): Promise<void> {
127127
try {
128128
// For new sessions or sessions awaiting initialization
129-
if (!session || session.status === 'paused') {
129+
if (!session) {
130130
await this.initNewSession(instance, remoteJid, bot, settings, session, content, pushName, msg);
131131
return;
132132
}
133133

134+
// If session is paused, ignore the message
135+
if (session.status === 'paused') {
136+
return;
137+
}
138+
134139
// For existing sessions, keywords might indicate the conversation should end
135140
const keywordFinish = (settings as any)?.keywordFinish || '';
136141
const normalizedContent = content.toLowerCase().trim();

0 commit comments

Comments
 (0)