Closed abdlhay closed 6 months ago
I discovered the solution by referring to issue #334
val mediaMessage = info.message().content() as ImageMessage
if (mediaMessage.mediaType() == MediaMessageType.IMAGE) {
val future = api.downloadMedia(mediaMessage)
val media = future.join()
val image = ImageMessageSimpleBuilder()
.media(media.get())
.caption(mediaMessage.caption().get())
.build()
api.sendMessage(info.parentJid(), image)
}
Note : using Cobalt 0.0.1
first of all thank you so much for creating this library
Based on the example in this repo WhatsappBotListener.java I tried :
but it didn't work, tried to log the result of this message nothing appeared
kindly someone guide me on how to achieve this. I already checked Javadoc but classes/methods have unclear description