Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for sticker Name and author #527

Merged
merged 55 commits into from May 31, 2021
Merged

Add support for sticker Name and author #527

merged 55 commits into from May 31, 2021

Conversation

PurpShell
Copy link
Sponsor Collaborator

@PurpShell PurpShell commented Jan 29, 2021

This adds sticker name and author support by modifying EXIF metadata of the webp sticker file. I extracted the exif data from a legit sticker, so this should function properly...
Example image

image

@PurpShell
Copy link
Sponsor Collaborator Author

this also requires the installation of an npm package called "webp-convert"

Copy link
Contributor

@mpirescarvalho mpirescarvalho left a comment

Choose a reason for hiding this comment

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

First, all my comments are just suggestions, I'm not the one who will merge this.

I suggest you to fix linting issues, this will make you PR gets more attention.

Another thing is that I don't think this code should be added in Client.js file, maybe processStickerData function at Injected.js would be a better place to handle this

If I can help you in some way just let me know, I'm looking forward to use this feature.

src/Client.js Outdated Show resolved Hide resolved
src/Client.js Outdated Show resolved Hide resolved
@PurpShell
Copy link
Sponsor Collaborator Author

PurpShell commented Feb 2, 2021

If I can help you in some way just let me know, I'm looking forward to use this feature.

Thanks, that would be appreciated as I don't have much experience in puppeteer.

Copy link
Sponsor Collaborator Author

@PurpShell PurpShell left a comment

Choose a reason for hiding this comment

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

Fixed

src/Client.js Outdated Show resolved Hide resolved
@PurpShell
Copy link
Sponsor Collaborator Author

Credits go to @mpirescarvalho for refactoring the code

@PurpShell
Copy link
Sponsor Collaborator Author

just finished another batch of commits, yeah ik i should have tested locally because all of this is just linting.
Optimizations: Now gotten rid of setting temporary files, just uses built in functions to load the image / animation

@PurpShell
Copy link
Sponsor Collaborator Author

This is the last commit i am gonna publish to this pr, unless anything goes wrong..

@PurpShell
Copy link
Sponsor Collaborator Author

@pedroslopez
check this one out :)

@PurpShell PurpShell marked this pull request as draft May 9, 2021 17:32
@PurpShell PurpShell marked this pull request as ready for review May 9, 2021 17:32
@PurpShell
Copy link
Sponsor Collaborator Author

Just added sticker Categories, it is an array of emojies that put your stickers in the categories menu of stickers.

For more info: https://github.com/WhatsApp/stickers/wiki/Tag-your-stickers-with-Emojis

@pedroslopez
Copy link
Owner

Thank you!

@pedroslopez pedroslopez merged commit efc7018 into pedroslopez:master May 31, 2021
harish2704 added a commit to harish2704/whatsapp-web.js that referenced this pull request Jun 9, 2021
# By Pedro S. Lopez (3) and others
# Via GitHub
* 'master' of github.com:harish2704/whatsapp-web.js:
  Update lint.yml
  feat: acceptGroupV4Invite (pedroslopez#677)
  chore: update eslint and ecmaVersion (pedroslopez#680)
  chore: update lint action (pedroslopez#679)
  feat(dev): add argument bypassCSP to use in pupperter (pedroslopez#635)
  add searchMessages method (pedroslopez#586)
  feat: Add from which device the message was sent (pedroslopez#648)
  feat: disable / enable WA Web features (pedroslopez#543)
  feat: Get Orders and Products (pedroslopez#612)
  add extra option to MessageSendOptions (pedroslopez#600)
  feat: openChatWindow can open new chats (pedroslopez#592)
  Add sendVideoAsGif option (pedroslopez#578)
  Add support for sticker Name and author (pedroslopez#527)

# Conflicts:
#	package.json
ricardoapaes added a commit to likesistemas/whatsapp-web.js that referenced this pull request Jul 5, 2021
Belfio pushed a commit to Belfio/whatsapp-web.js that referenced this pull request Jan 9, 2024
* Added Sticker author and sticker name support

This patch of Client.js includes support for sticker metadata

* Docs: stickerName and stickerAuthor in MessageOpts

* Hotfix_Sticker_Feature

fixes a bug

* Update global.html

* updated

* fixed comma

* Fixed duplicate code

* Fixing eslint

* Fixing eslint again

* eslint....

* fixing problem with eslint.

* move sticker exif data filling to Utils.formatToWebpSticker() function

* Update Client.js

* Added temporary stuff

* eslint

* Update Util.js

* eslint bad :D

* eslint

* polish work with files

* fix error and TODOs

* clean up code to match with repo code style

* update typescript params

* Update src/util/Util.js

camel Case

Co-authored-by: Pedro S. Lopez <pedroslopez@me.com>

* Update Util.js

* ➖ webp-converter ➕ node-webpmux

* Update Util.js

* ✨ Use node-webpmux

* ➖ node-webpmux ➕ node-webpmux-commonjs

* ✏️ Fixed require mode

* ➕node-webpmux ➖ node-webpmux-commonjs

* ⬆️ Node-webpmux update changes

* 🚨 removing try/catch

* 🚨 complier warnings

* 🧐 stupid mistakes

* ⬆️ Upgrade required version

* 🐛 creating a buffer the right way

* 🐛 linting and simplification

* 🐛 unsimplification

* 🚨 eslint loves singlequotes

* ✨ Added emojis / categories in metadata

* 🏷️ TypeScript Declarations

* ✨ Sticker Categories in sendMessage

* 🏷️ Improved TS declarations

* fix stickerCategories type

* fix: don't set name/author if not defined

Co-authored-by: Marcelo Carvalho <mpirescarvalho17@gmail.com>
Co-authored-by: Pedro S. Lopez <pslamoros@hotmail.com>
Co-authored-by: Pedro S. Lopez <pedroslopez@me.com>
@Nurutomo Nurutomo mentioned this pull request Mar 3, 2024
1 task
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.

None yet

5 participants