← Back to PRs

#19592: feat(whatsapp): add sendAsSticker support

by qualiobra open 2026-02-18 00:35 View on GitHub →
channel: whatsapp-web agents size: XS
## Summary Adds a `sendAsSticker` boolean option to the message tool and WhatsApp outbound pipeline. When set to `true`, images sent via WhatsApp are converted and delivered as stickers instead of regular image messages. ## Motivation WhatsApp stickers are a widely used messaging format. Currently, there is no way to send an image as a sticker through the message tool — images are always sent as regular image attachments. This PR adds first-class support for sticker delivery, enabling agents and API consumers to send sticker messages by simply setting `sendAsSticker: true`. ## Changes The implementation threads a `sendAsSticker` boolean through the existing outbound pipeline: - **Message tool schema** (`message-tool.ts`): Added `sendAsSticker` as an optional boolean parameter - **WhatsApp outbound adapter** (`whatsapp.ts`): Passes `sendAsSticker` through to the send functions - **Channel outbound context type** (`types.adapters.ts`): Added `sendAsSticker` to the shared context type - **Delivery infrastructure** (`deliver.ts`): Threads `sendAsSticker` through handler params, context base, and delivery queue - **Active listener types** (`active-listener.ts`): Added `sendAsSticker` to `ActiveWebSendOptions` - **Send API** (`send-api.ts`): When `sendAsSticker` is true and the media is an image, constructs a sticker payload instead of an image payload - **Outbound sender** (`outbound.ts`): Passes `sendAsSticker` into the send options ## Usage ```json { "action": "send", "target": "<phone or group JID>", "media": "https://example.com/image.png", "sendAsSticker": true } ``` The image will be sent as a WhatsApp sticker. When `sendAsSticker` is not set or `false`, behavior is unchanged — images are sent normally. ## Scope - 7 files changed, ~21 lines added - No breaking changes — the new parameter is optional and defaults to `false`/`undefined` - Only affects WhatsApp channel; other channels ignore the parameter <!-- greptile_comment --> <h3>Greptile Summary</h3> Added `sendAsSticker` boolean option to enable sending images as WhatsApp stickers through the message tool and outbound pipeline. The implementation correctly threads the parameter through all layers (message tool schema, channel adapters, delivery infrastructure, and send API). When enabled, images are sent as sticker payloads instead of image messages with captions. - Threads `sendAsSticker` through 7 files across the outbound pipeline - Only affects WhatsApp channel; other channels ignore the parameter - No breaking changes - optional parameter defaults to false/undefined - Implementation is clean and follows existing patterns (similar to `gifPlayback`) - Note: WhatsApp stickers don't support captions, so any text passed with `sendAsSticker: true` will be ignored <h3>Confidence Score: 5/5</h3> - This PR is safe to merge with minimal risk - The implementation is straightforward, non-breaking, and follows established patterns. The `sendAsSticker` parameter is optional, properly threaded through all layers, and only affects WhatsApp. The code is clean with no logical errors or security concerns. The only minor consideration is the implicit behavior that text/captions are ignored for stickers, which is standard WhatsApp behavior. - No files require special attention <sub>Last reviewed commit: d8a5b30</sub> <!-- greptile_other_comments_section --> <sub>(5/5) You can turn off certain types of comments like style [here](https://app.greptile.com/review/github)!</sub> <!-- /greptile_comment -->

Most Similar PRs