{{ message }}
fix(evolutionbot): Fixing the correct message sending method so that messages are split.#1986
Merged
DavidsonGomes merged 3 commits intoEvolutionAPI:developfrom Sep 22, 2025
Merged
Conversation
- Replace instance.textMessage() with sendMessageWhatsApp() method - Enable message splitting by double line breaks (\n\n) - Add proper delay and typing indicators between split messages - Fix linkPreview parameter passing to base class methods - Support linkPreview: false/true from webhook response - Remove unnecessary debug logs for cleaner output Fixes: EvolutionBot was not respecting splitMessages and linkPreview configurations
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes message handling in the EvolutionBot by switching from direct instance.textMessage() calls to the base class sendMessageWhatsApp() method, enabling proper message splitting functionality and linkPreview parameter handling.
- Replace direct textMessage() calls with base class method to enable message splitting
- Add linkPreview parameter support throughout the message sending chain
- Remove unnecessary debug logging for cleaner output
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/api/integrations/chatbot/evolutionBot/services/evolutionBot.service.ts | Replaced direct textMessage() call with base class sendMessageWhatsApp() method and removed debug logs |
| src/api/integrations/chatbot/base-chatbot.service.ts | Added linkPreview parameter to sendMessageWhatsApp() and sendFormattedText() methods |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Contributor
There was a problem hiding this comment.
Hey there - I've reviewed your changes - here's some feedback:
- Centralize the double-line-break message splitting logic into a dedicated helper to keep sendMessageWhatsApp focused and make the split behavior easier to unit-test.
- Since most debug logs were removed, add back targeted, log-level-gated statements around key events (like before/after splitting and sending messages) to retain observability without clutter.
- Ensure the new linkPreview parameter is reflected in all type definitions, mocks, and any callers of sendMessageWhatsApp, so the default-true behavior is consistently enforced.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Centralize the double-line-break message splitting logic into a dedicated helper to keep sendMessageWhatsApp focused and make the split behavior easier to unit-test.
- Since most debug logs were removed, add back targeted, log-level-gated statements around key events (like before/after splitting and sending messages) to retain observability without clutter.
- Ensure the new linkPreview parameter is reflected in all type definitions, mocks, and any callers of sendMessageWhatsApp, so the default-true behavior is consistently enforced.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
…istency - 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
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Fixes: EvolutionBot was not respecting splitMessages and linkPreview configurations
📋 Description
After adding linkpreview: false, messages were no longer being split correctly. Now it has been fixed, messages are being split, debouce time tested, linkpreview tested with true and false and working.
Summary by Sourcery
Improve messaging reliability by switching to the proper sendMessageWhatsApp method, re-enabling message splitting with delays and typing indicators, and fixing linkPreview support while cleaning up debug logging
New Features:
Bug Fixes:
Enhancements: