mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-12-27 15:47:45 -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:
@@ -107,7 +107,7 @@ export class DifyService extends BaseChatbotService<Dify, DifySetting> {
|
||||
const conversationId = response?.data?.conversation_id;
|
||||
|
||||
if (message) {
|
||||
await this.sendMessageWhatsApp(instance, remoteJid, message, settings);
|
||||
await this.sendMessageWhatsApp(instance, remoteJid, message, settings, true);
|
||||
}
|
||||
|
||||
await this.prismaRepository.integrationSession.update({
|
||||
@@ -169,7 +169,7 @@ export class DifyService extends BaseChatbotService<Dify, DifySetting> {
|
||||
const conversationId = response?.data?.conversation_id;
|
||||
|
||||
if (message) {
|
||||
await this.sendMessageWhatsApp(instance, remoteJid, message, settings);
|
||||
await this.sendMessageWhatsApp(instance, remoteJid, message, settings, true);
|
||||
}
|
||||
|
||||
await this.prismaRepository.integrationSession.update({
|
||||
@@ -246,7 +246,7 @@ export class DifyService extends BaseChatbotService<Dify, DifySetting> {
|
||||
await instance.client.sendPresenceUpdate('paused', remoteJid);
|
||||
|
||||
if (answer) {
|
||||
await this.sendMessageWhatsApp(instance, remoteJid, answer, settings);
|
||||
await this.sendMessageWhatsApp(instance, remoteJid, answer, settings, true);
|
||||
}
|
||||
|
||||
await this.prismaRepository.integrationSession.update({
|
||||
|
||||
Reference in New Issue
Block a user