mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-12-19 11:52:20 -06:00
refactor(chatbot): unify keywordFinish type and enhance session handling
- Changed the type of `keywordFinish` from an array to a string in multiple DTOs and controller interfaces to simplify data handling. - Updated the `BaseChatbotService` to include logic for updating session status to 'opened' and managing user responses more effectively. - Refactored the media message handling in the `BaseChatbotService` to streamline the process and improve readability. - Enhanced error logging across various services to ensure better traceability during operations. This commit focuses on improving the structure and consistency of chatbot integrations while ensuring that session management is robust and user-friendly.
This commit is contained in:
@@ -31,7 +31,7 @@ export interface BaseBotData {
|
||||
enabled?: boolean;
|
||||
description: string;
|
||||
expire?: number;
|
||||
keywordFinish?: string[];
|
||||
keywordFinish?: string;
|
||||
delayMessage?: number;
|
||||
unknownMessage?: string;
|
||||
listeningFromMe?: boolean;
|
||||
@@ -792,7 +792,7 @@ export abstract class BaseChatbotController<BotType = any, BotData extends BaseC
|
||||
const content = getConversationMessage(msg);
|
||||
|
||||
// Get integration type
|
||||
const integrationType = this.getIntegrationType();
|
||||
// const integrationType = this.getIntegrationType();
|
||||
|
||||
// Find a bot for this message
|
||||
let findBot: any = await this.findBotTrigger(this.botRepository, content, instance, session);
|
||||
|
||||
Reference in New Issue
Block a user