mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-12-20 12:22:21 -06:00
- 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.
43 lines
1.0 KiB
TypeScript
43 lines
1.0 KiB
TypeScript
import { TriggerOperator, TriggerType } from '@prisma/client';
|
|
|
|
/**
|
|
* Base DTO for all chatbot integrations
|
|
* Contains common properties shared by all chatbot types
|
|
*/
|
|
export class BaseChatbotDto {
|
|
enabled?: boolean;
|
|
description: string;
|
|
expire?: number;
|
|
keywordFinish?: string;
|
|
delayMessage?: number;
|
|
unknownMessage?: string;
|
|
listeningFromMe?: boolean;
|
|
stopBotFromMe?: boolean;
|
|
keepOpen?: boolean;
|
|
debounceTime?: number;
|
|
triggerType: TriggerType;
|
|
triggerOperator?: TriggerOperator;
|
|
triggerValue?: string;
|
|
ignoreJids?: string[];
|
|
splitMessages?: boolean;
|
|
timePerChar?: number;
|
|
}
|
|
|
|
/**
|
|
* Base settings DTO for all chatbot integrations
|
|
*/
|
|
export class BaseChatbotSettingDto {
|
|
expire?: number;
|
|
keywordFinish?: string;
|
|
delayMessage?: number;
|
|
unknownMessage?: string;
|
|
listeningFromMe?: boolean;
|
|
stopBotFromMe?: boolean;
|
|
keepOpen?: boolean;
|
|
debounceTime?: number;
|
|
ignoreJids?: any;
|
|
splitMessages?: boolean;
|
|
timePerChar?: number;
|
|
fallbackId?: string; // Unified fallback ID field for all integrations
|
|
}
|