Unable to download full image / document content
Hi,
I'm using version 0.0.10 (java 21) And trying to send a image message to a contact
my code:
var chat = whatsAppApi.store()
.findChatByName("contactname")
.orElseThrow(() -> new NoSuchElementException("Chat does not exist!"));
var media = Files.readAllBytes(Path.of("C:\\whatsapp\\test.jpg"));
var imageMessageBuilder = new ImageMessageSimpleBuilder() // Create a new image message builder
.media(media) // Set the image of this message
.mimeType("image/jpeg")
.caption("test image");
var image = imageMessageBuilder.build();
whatsAppApi.sendMessage(chat,image).join();
I am (the contactname) receiving the image in a preview status: (preview seems correct)
But it's unable to download the full image itself.
When i try to download i got the message (translated)
Unable to download image. Please try again. Turn off Wi-Fi or VPN, or connect to a different Wi-Fi network if the issue persists.
I have also tested this with the DocumentMessageSimpleBuilder, same behavior. I'm able to retrieve the message but unable to actual download the document itself.
Am i missing something here?
Thanks for helping me out of this!!
Hi, I am facing the same issue, did you find any solutions or workaround for this?
Hey @NotaCoder20 , Unfortunately not, and it is unlikely that this will be fixed in the current release / stack. This is due to the status of the current master branch, which is Java 25 and contains a whole series of refactoring packages / content / logic / ...
I am currently looking more at the master branch, but unfortunately, sending a message has not yet been implemented and nothing works at the moment as sending is concerned. https://github.com/Auties00/Cobalt/blob/c2392d9af6c2c96fb8fa2a7f88f6c6c80d3c75c6/src/main/java/com/github/auties00/cobalt/client/WhatsAppClient.java#L1689
// TODO: Implement message sending
private <T extends MessageInfo> T sendMessage0(T info, Map<String, ?> attributes) {
throw new UnsupportedOperationException("Not yet implemented");
}
I have also been blocked by this for a while, as no version seems to work (able to send a image correctly) at the moment. Any help is welcome.
@Auties00 I'm also willing to help if possible, hence my request: https://github.com/Auties00/Cobalt/discussions/661
Hey @GDB4J Thanks for the update, I was able to make normal send message work with the help of examples but not for the images, I am trying https://github.com/WhiskeySockets/Baileys you can maybe try this as well if sending media is blocker for you.
Hey @NotaCoder20 , Unfortunately not, and it is unlikely that this will be fixed in the current release / stack. This is due to the status of the current master branch, which is Java 25 and contains a whole series of refactoring packages / content / logic / ...
I am currently looking more at the master branch, but unfortunately, sending a message has not yet been implemented and nothing works at the moment as sending is concerned.
Cobalt/src/main/java/com/github/auties00/cobalt/client/WhatsAppClient.java
Line 1689 in c2392d9
throw new UnsupportedOperationException("Not yet implemented"); // TODO: Implement message sending private <T extends MessageInfo> T sendMessage0(T info, Map<String, ?> attributes) { throw new UnsupportedOperationException("Not yet implemented"); } I have also been blocked by this for a while, as no version seems to work (able to send a image correctly) at the moment. Any help is welcome.
@Auties00 I'm also willing to help if possible, hence my request: #661
You have to fork the repo, clone your repo, push to your repo and then you will be able to open a PR
by the way I'll make sure to release message sending on the master branch as soon as possible, LID handlind is not simple and I'm trying to get it right
You have to fork the repo, clone your repo, push to your repo and then you will be able to open a PR
Thx, open PR: https://github.com/Auties00/Cobalt/pull/663
by the way I'll make sure to release message sending on the master branch as soon as possible, LID handlind is not simple and I'm trying to get it right
Thanks! Would be very nice if this would work again!!
@Auties00
by the way I'll make sure to release message sending on the master branch as soon as possible, LID handlind is not simple and I'm trying to get it right
Hey! Quick check on the message sending release to master — have you already started working on it (e.g., a branch or draft PR)? Also, do you have a rough ETA (days vs weeks)? Totally understand LID handling is tricky — we just need an approximate timeline to plan.