Skip to content

Conversation

@sergiooak
Copy link

PR Details

Summary:
Adds support for sending sticker packs, updates typings, and provides usage examples.

Description

  • Introduced sendMediaAsStickerPack option to the API and typings.
  • Implemented logic for creating and sending sticker packs.
  • Updated example.js with new commands for sticker and sticker pack sending.
  • Added required dependencies: archiver, sharp.
  • Improved type definitions and internal documentation.

Motivation and Context

This change allows users to send multiple stickers as a pack, improving feature parity with WhatsApp’s native functionality and expanding bot/media capabilities.

How Has This Been Tested

  • Manual testing using the updated example.js bot commands (!sticker, !pack).
  • Verified sticker and sticker pack sending in group and private chats.

Environment

  • Machine OS: Windows 11
  • Phone OS: Android 14
  • Library Version: 2.3000.1024258380
  • WhatsApp Web Version: 2.3000.1024258380
  • Puppeteer Version: 18.2.1
  • Browser Type and Version: Chrome 138
  • Node Version: v22.15.0

Types of changes

  • Dependency change
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • I have updated the documentation accordingly (index.d.ts).
  • I have updated the usage example accordingly (example.js)

- Added sendMediaAsStickerPack option to API and typings
- Implemented sticker pack creation and sending logic
- Updated example.js with !sticker and !pack commands
- Added required dependencies: archiver, sharp
- Improved type definitions and
@sergiooak
Copy link
Author

sergiooak commented Jun 27, 2025

Sticker Packs in Chat:


Sticker Pack on Whatsapp Sticker Seach

Including custom Thumbnail

@sergiooak
Copy link
Author

sergiooak commented Jun 27, 2025

Known Bug:

The stickers previews don't load automatically, it just happens after you open the sticker pack for the first time
image

@alechkos alechkos added the dependencies Pull requests that update a dependency file label Jun 27, 2025
@sergiooak
Copy link
Author

@alechkos About the introduced dependencies, it uses the before optionals archiver and unzipper, and the sharp is used to generate the pack thumbnail.
I guess we can keep the deps as optionals, like the approach on url preview generation, and avoid sharp using another way of generating the png, what do you think:

Copy link
Contributor

@alechkos alechkos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't use sharp.

@sergiooak
Copy link
Author

Yeah, I figured out why already haha, tomorrow I'll rework to get rid of sharp

@sergiooak sergiooak changed the title feat(sticker-pack): add support for sending sticker packs feat: add support for sending sticker packs Jun 29, 2025
- Downgraded 'archiver' from ^7.0.1 to ^5.3.1
- Rolled back 'unzipper' from ^0.10.14 to ^0.10.11
- Reverted other version changes introduced in the PR
@sergiooak
Copy link
Author

sergiooak commented Jun 29, 2025

@alechkos I've removed Sharp from the stack and now use window.WWebJS.cropAndResizeImage to generate the 64x64px PNG for the sticker-pack thumbnail


Also, to ease my OCD, could you approve the PR: wwebjs/wwebjs.dev#97

@sergiooak sergiooak requested a review from alechkos June 29, 2025 20:43
@alechkos alechkos removed the dependencies Pull requests that update a dependency file label Jun 30, 2025
@sergiooak
Copy link
Author

@alechkos and @tuyuribr I need to do anything to be able to merge this?

Copy link
Contributor

@alechkos alechkos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @sergiooak, I tested and it seems that there is no difference between sending a regular pack and one with a custom thumbnail.

@alechkos
Copy link
Contributor

alechkos commented Aug 6, 2025

Also, you can't add a sticker pack to your stickers, it responds in Failed to download sticker pack message.

@purpshell purpshell requested a review from tuyuribr November 20, 2025 11:36
@lindionez
Copy link

The idea is great, I hope this functionality will be added one day.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants