fix: ajuste na validacao dos bots e pausar sessao

This commit is contained in:
Joao Vitor
2025-06-15 18:24:34 -03:00
parent a1fae85531
commit 029d68e2cd
3 changed files with 19 additions and 7 deletions

View File

@@ -880,6 +880,12 @@ export abstract class BaseChatbotController<BotType = any, BotData extends BaseC
return;
}
// Skip if session exists and status is paused
if (session && session.status === 'paused') {
this.logger.warn(`Session for ${remoteJid} is paused, skipping message processing`);
return;
}
// Merged settings
const mergedSettings = {
...settings,

View File

@@ -194,13 +194,13 @@ export class ChatbotController {
instance: InstanceDto,
session?: IntegrationSession,
) {
let findBot: null;
let findBot: any = null;
if (!session) {
findBot = await findBotByTrigger(botRepository, content, instance.instanceId);
if (!findBot) {
return;
return null;
}
} else {
findBot = await botRepository.findFirst({