sulla icon indicating copy to clipboard operation
sulla copied to clipboard

Is sendImageAsSticker working?

Open renato-macedo opened this issue 4 years ago • 6 comments

I followed the README and called await client.sendImageAsSticker(chatId, pathToImage); but it didn't work, also didn't throw any error

renato-macedo avatar Apr 20 '20 07:04 renato-macedo

Please add also the code used to send it along with the chatid and the pathtoimage

robertsLando avatar Apr 20 '20 12:04 robertsLando

The text message is sent but the sticker is not, the pathtoimage is also correct

import * as sulla from 'sulla'

sulla.create().then(client => start(client))

function start (client: sulla.Whatsapp) {
  client.onMessage(async message => {
    if (message.body === 'Hi') {
      
      await client.sendText(message.from, '👋 Hello')
      await client.sendImageAsSticker(message.from,'./assets/image.jpg')
    }
  })
}

renato-macedo avatar Apr 20 '20 16:04 renato-macedo

Just to be sure, could you use sendFile instead of sendImageAsSticker? Just to see if that works. Also try to start sulla by setting headless to false and devtools to true and check if there is any error on dev console of the browser windows that opens


Daniel - Software Engineer

Support me at: Github sponsors

On 20 Apr 2020, at 18:52, Renato Macêdo [email protected] wrote:

 The text message is sent but the sticker is not, the pathtoimage is also correct

`import * as sulla from 'sulla'

sulla.create().then(client => start(client))

function start (client: sulla.Whatsapp) { client.onMessage(async message => { if (message.body === 'Hi') {

await client.sendText(message.from, '👋 Hello') await client.sendImageAsSticker(message.from,'./assets/image.jpg') } }) }`

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

robertsLando avatar Apr 20 '20 18:04 robertsLando

sendFile worked, but still there is nothing on the console of the browser window

renato-macedo avatar Apr 20 '20 19:04 renato-macedo

For me sendassticker is working.

Are you using a PNG? size 512 x 512 works for me

roelandp avatar May 11 '20 09:05 roelandp

UnhandledPromiseRejectionWarning: Error: Input buffer contains unsupported image format

Getting this after trying to sendImageAsSticker() executed.

EdoWahdana avatar May 24 '20 14:05 EdoWahdana