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.

Can't delete own message

See original GitHub issue

Message toSend = new MessageBuilder().append("aa").build(); channel.sendMessage(toSend).queue(); message.delete().complete(); toSend.delete().queueAfter(5, TimeUnit.SECONDS);

The last line returns a NPE. at net.dv8tion.jda.core.entities.impl.MessageImpl.delete(MessageImpl.java:471)

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
MinnDevelopmentcommented, Oct 6, 2017

You can’t delete messages from message builder, these messages have no ID assigned and thus cannot be modified or deleted. You need to use the response message from sendMessage:

channel.sendMessage(toSend).queue( message -> message.delete().queueAfter(5, TimeUnit.SECONDS) );
3reactions
ghostcommented, Dec 28, 2019

maybe you’re bot doesn’t have permissions for deleting message

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't Delete Text Messages from iPhone - Easy Fix
If you can't delete text messages from iPhone, access Settings > Messages > Keep Messages. Select the 30 days time frame and reset...
Read more >
Can't delete my own messages : r/discordapp - Reddit
I'm a mod on a server and for the past 3 days or so I've been unable to delete some messages even though...
Read more >
Can't delete text messages in iOS 16.0.2 - Apple Community
In messages got to Edit>Show Recently Deleted. Find the person you want to delete, select them and hit "delete". Go back to your...
Read more >
Unable to delete text messages on Samsung phone
Basic troubleshooting for when messages will not delete · Verify your carrier service status. · Inspect the device. · Inspect the SIM card....
Read more >
Why you can't delete a text message - Free Grace International
Have you ever tried to delete a text message, only to find the person you are talking to still has access to it?...
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