Support Image/webp
renatovico opened this issue · 2 comments
renatovico commented
Describe the bug
When receive a image/webp (sticker eg) the download medias doesn't work
To Reproduce
- Send a sticker image
- Try download :)
Expected behavior
Download happened
Additional context
I Made a ugly monkey patch
WhatsappSdk::Resource::MediaTypes::IMAGE_TYPES = WhatsappSdk::Resource::MediaTypes::IMAGE_TYPES.dup
WhatsappSdk::Resource::MediaTypes::IMAGE_TYPES.push("image/webp")
WhatsappSdk::Resource::MediaTypes::IMAGE_TYPES.freeze
WhatsappSdk::Resource::MediaTypes::SUPPORTED_MEDIA_TYPES = WhatsappSdk::Resource::MediaTypes::SUPPORTED_MEDIA_TYPES.dup
WhatsappSdk::Resource::MediaTypes::SUPPORTED_MEDIA_TYPES.push("image/webp")
WhatsappSdk::Resource::MediaTypes::SUPPORTED_MEDIA_TYPES.freeze
and all worked :)
ignacio-chiazzo commented
Hi! Thanks for reporting. We definitely need to add support for webp
for stickers.
It's in the Whatsapp documentation too.
Do you want to open a PR for that? We need:
- Add
image/webp
to https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk/blob/main/lib/whatsapp_sdk/resource/media_types.rb under a new variableSTICKERS_MEDIA
. - Add an entry on CHANGELOG.md https://github.com/ignacio-chiazzo/ruby_whatsapp_sdk/blob/0cb4187c8530f9d6a85f8dac79f3617434145b43/CHANGELOG.md (you can include your name if you want)
If not, I can write it. Thanks for reporting the issue!
renatovico commented
of course i do!