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 ability to send stickers #215

Open
AKhateeb opened this issue May 13, 2024 · 7 comments
Open

Add ability to send stickers #215

AKhateeb opened this issue May 13, 2024 · 7 comments
Labels
question Further information is requested

Comments

@AKhateeb
Copy link

I can see that we can easily send stickers using WhatsApp Web, I'd be grateful if you could add a method to send stickers (which is different from sending PNG image as sending PNGs has no transparency where sending stickers has)

@chrishubert
Copy link
Owner

You should be able to do it already by passing the option sendMediaAsSticker when you send your message.
https://docs.wwebjs.dev/global.html#MessageSendOptions

Give it a try and let us know if it works!

@chrishubert chrishubert added the question Further information is requested label May 17, 2024
@AKhateeb
Copy link
Author

it didn't work, I've added this option to the payload of {{baseUrl}}/client/sendMessage/:sessionId let me know if I should another API endpoint to send stickers @chrishubert

@manoedinata
Copy link

Don't forget to use sendMediaAsSticker. Pass it in options.

Ref: https://docs.wwebjs.dev/global.html#MessageSendOptions

@AKhateeb
Copy link
Author

I can see no options in that request {{baseUrl}}/client/sendMessage/:sessionId I'm using this repository as API, all retries failed, I didn't find anything helpful in the Swagger Documentation :(

@manoedinata
Copy link

I can see no options in that request {{baseUrl}}/client/sendMessage/:sessionId I'm using this repository as API, all retries failed, I didn't find anything helpful in the Swagger Documentation :(

You need to pass it, even if it's not mentioned in Swagger.

@AKhateeb
Copy link
Author

Thanks it works now, I was confused by the attribute name, this is the request if anyone wants to know about it:

{
    "chatId": "*****@c.us",
    "contentType": "MessageMediaFromURL",
    "content": "https://**********/img.png",
    "options": {
        "sendMediaAsSticker": true
    }
}

@manoedinata
Copy link

Good to know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants