whatsapp-api icon indicating copy to clipboard operation
whatsapp-api copied to clipboard

Fixup usage of reply method

Open manoedinata opened this issue 8 months ago • 2 comments

According to whatsapp-web.js offical documentation [1], reply method can be used by specifying:

  1. content: can be string, MessageMedia, or Location
  2. chatId: ID of target chat
  3. options: Additional message options

However, current reply route implementation doesn't support content type other than string content, so replying with MessageMedia or similar won't work.

Since these parameters are very similar with Client.sendMessage() method, we can add switch-case to check the specified contentType, just like we did in sendMessage API route. This way, we can reply with another content type.

[1] https://docs.wwebjs.dev/Message.html#reply

manoedinata avatar Jun 13 '24 10:06 manoedinata