Wa-automate-nodejs: Is there any way to send a GIF image as an animated sticker?

Created on 7 Aug 2020  路  7Comments  路  Source: open-wa/wa-automate-nodejs

enhancement

Most helpful comment

@YogaSakti @AlenSaito1 This is now implemented in v2.0.0

https://open-wa.github.io/wa-automate-nodejs/classes/client.html#sendgiphyassticker

All 7 comments

@AlenSaito1 Yes I just figured it out. However, there are a few points:

  1. For now, it will only be able to send GIPHY links (in the format: https://media.giphy.com/media/RJKHjCAdsAfQPn03qQ/source.gif) as stickers
  2. Sticker's are expected to be in a 1:1 aspect ratio format, therefore if your chosen gif is not in that format it will cause issues. In web, the GIF will be stretched. On mobile, the GIF will show up in the correct aspect ratio and anchored at the top when it is being played, when it is not being played the GIF still image will be stretched.
  3. GIF stickers don't seem to play at all on business accounts.

To counteract the aspect ratio issue, I plan on making a serverless application that will consume a video, convert it to a GIF with transparent borders (to achieve a 1:1 aspect ratio), then upload the GIF to Giphy (via API) and then return a Giphy link. This is not a high priority for now though.

You said that you can send GIPHY links as stickers, has that been implemented? does it use the "sendRawWebpAsSticker" function?

@YogaSakti no it does not, the process is different. The main reason for connecting this functionality with giphy is that it is the largest source for properly formatted stickers + I don't want issues down the line of someone not formatting an animated sticker correctly and using a native method.

I highly encourage anyone using this upcoming functionality to just grab an API key from GIPHY and just let GIPHY do the formatting + conversion.

@YogaSakti @AlenSaito1 This is now implemented in v2.0.0

https://open-wa.github.io/wa-automate-nodejs/classes/client.html#sendgiphyassticker

@AlenSaito1 Yes I just figured it out. However, there are a few points:

  1. For now, it will only be able to send GIPHY links (in the format: https://media.giphy.com/media/RJKHjCAdsAfQPn03qQ/source.gif) as stickers
  2. Sticker's are expected to be in a 1:1 aspect ratio format, therefore if your chosen gif is not in that format it will cause issues. In web, the GIF will be stretched. On mobile, the GIF will show up in the correct aspect ratio and anchored at the top when it is being played, when it is not being played the GIF still image will be stretched.
  3. GIF stickers don't seem to play at all on business accounts.

image

I don't know why the second link are giving no respond while the first and the third(the same link) give the respond

even I tried to change the link to source.gif only the first and the third give respond, the second link give no respond

@AlenSaito1 Yes I just figured it out. However, there are a few points:

  1. For now, it will only be able to send GIPHY links (in the format: https://media.giphy.com/media/RJKHjCAdsAfQPn03qQ/source.gif) as stickers
  2. Sticker's are expected to be in a 1:1 aspect ratio format, therefore if your chosen gif is not in that format it will cause issues. In web, the GIF will be stretched. On mobile, the GIF will show up in the correct aspect ratio and anchored at the top when it is being played, when it is not being played the GIF still image will be stretched.
  3. GIF stickers don't seem to play at all on business accounts.

image

I don't know why the second link are giving no respond while the first and the third(the same link) give the respond

even I tried to change the link to source.gif only the first and the third give respond, the second link give no respond

try this code from my repo https://github.com/YogaSakti/imageToSticker/blob/master/handler/message/index.js#L105

Was this page helpful?
0 / 5 - 0 ratings