whatsapp-api
whatsapp-api copied to clipboard
Fixup usage of reply method
According to whatsapp-web.js offical documentation [1], reply method can be used by specifying:
-
content
: can be string, MessageMedia, or Location -
chatId
: ID of target chat -
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