question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Messages won't disappear when disappearing is enabled for group

See original GitHub issue

Hi @Auties00 !

Great thanks for this API! Keep up the good work! I’m stil figuring out a lot of things in your API.

Question: When disappearing messages is enabled in a group chat, the messages actually don’t dissapear 😦

Left from every message (text, image, …) there is a info icon, with this message: image

I have also tried with configuring the version to the latest version by settings the Options: .version(new Version(2, 2222, 11)) (according to https://web.whatsapp.com/check-update?version=%s&platform=web) Don’t know if this relevant for this issue? But nothing changed.

Is there a way to fix this? Or is there a way to set an expiry date on a message?

My setup: Spring boot 2.6.6 JDK 17.0.2 whatsappweb4j 3.0-RC11

Thanks for your time and effort in advance! Kind regards, G.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:9 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Auties00commented, Jun 26, 2022

@Auties00

Thanks this solved the problem indeed

Example:

        var message = TextMessage.newTextMessage() // Create a new text message
                .text("Test Message!") // Set the text of the message
                .contextInfo(new ContextInfo().expiration(60 * 60 * 24)) // Set expiration time to 24h (equals to your group setting)
                .create(); // Create the message
        api.sendMessage(chat, MessageContainer.ofEphemeral(message));

I’ll keep it open because this should be done automatically. I’ll fix it asap

0reactions
GDB4Jcommented, Jun 30, 2022

Hi @Auties00 ,

This is not working as default currently:

Using this piece of code to send a message to a group with dissapearingmode enabled:

var chat = api.store()
    .findChatByName("Chat_Group")
    .orElseThrow(() -> new NoSuchElementException("Chat does not exist!"));

var message = TextMessage.newTextMessage() // Create a new text message
        .text("Test Message!") // Set the text of the message
        .create(); // Create the message
api.sendMessage(chat, message);

The message is marked as “non deleteable” (like screenshots above).

Also when I’m trying to send like this: api.sendMessage(chat, MessageContainer.ofEphemeral(message)); It’s not working.

This is still needed to work correctly:

builder.contextInfo(new ContextInfo().ephemeralExpiration(60 * 60 * 24)) // Set expiration time to 24h (equals to group setting)
api.sendMessage(chat, MessageContainer.ofEphemeral(message));

I’ve tested this on version <version>3.0-RC13</version>

Thanks in advance to take a look at it. Kind regards

FYI: I can’t reopen the issue

Read more comments on GitHub >

github_iconTop Results From Across the Web

About disappearing messages | WhatsApp Help Center
In an individual chat, either user can turn disappearing messages on or off. In a group chat, any group participants can turn disappearing...
Read more >
Disappearing Messages on WhatsApp: Everything You Need ...
In individual chats, anyone can turn on disappearing messages. In group chats, only the admins can do this.
Read more >
How to turn on disappearing messages on WhatsApp
How to enable or disable disappearing messages on a group chat · Open WhatsApp · Open the group chat · Tap on the...
Read more >
Why you need to use disappearing messages on WhatsApp ...
Anyone can enable disappearing messages in a group, unless the admin changes the settings to allow only admins to turn the feature on...
Read more >
WhatsApp Disappearing Messages: 10 Hidden Things to Know!
Yes. As of now, there's no shortcut or switch to enable disappearing messages for all contacts at once. Instead, you need to manually...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found