mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-12-27 07:37:44 -06:00
refactor(chatbot): centralize split logic and ensure linkPreview consistency
- Centralize double-line-break message splitting logic into dedicated helper methods - Add targeted debug logs for better observability without clutter - Ensure linkPreview parameter is consistently passed across all chatbot services - Extract splitMessageByDoubleLineBreaks() and sendSingleMessage() helpers - Update all chatbot services to explicitly pass linkPreview: true - Improve code testability and maintainability Services updated: - BaseChatbotService: Refactored split logic and added debug logs - TypebotService: Added linkPreview parameter to all sendMessageWhatsApp calls - OpenAIService: Added linkPreview parameter to all sendMessageWhatsApp calls - N8nService: Added linkPreview parameter to sendMessageWhatsApp call - FlowiseService: Added linkPreview parameter to sendMessageWhatsApp call - EvoaiService: Added linkPreview parameter to sendMessageWhatsApp call - DifyService: Added linkPreview parameter to all sendMessageWhatsApp calls
This commit is contained in:
@@ -174,7 +174,7 @@ export class EvoaiService extends BaseChatbotService<Evoai, EvoaiSetting> {
|
||||
this.logger.debug(`[EvoAI] Extracted message to send: ${message}`);
|
||||
|
||||
if (message) {
|
||||
await this.sendMessageWhatsApp(instance, remoteJid, message, settings);
|
||||
await this.sendMessageWhatsApp(instance, remoteJid, message, settings, true);
|
||||
}
|
||||
} catch (error) {
|
||||
this.logger.error(
|
||||
|
||||
Reference in New Issue
Block a user