Message sends twice
See original GitHub issueHey,
Whenever I use something like
if (event.isFromType(ChannelType.PRIVATE)) //If this message was sent to a PrivateChannel
{
//The message was sent in a PrivateChannel.
//In this example we don't directly use the privateChannel, however, be sure, there are uses for it!
PrivateChannel privateChannel = event.getPrivateChannel();
System.out.printf("[PRIV]<%s>: %s\n", author.getName(), msg);
privateChannel.sendMessage("This message should only be sent once").queue();
}
And then I send the bot a message, it sends back mutliple times. Let me demonstrate: https://gyazo.com/3cf013f9330b9f1a4190a85ed86e46e0
Any idea why this might be happening? Using your exact example 💯
Issue Analytics
- State:
- Created 7 years ago
- Comments:6
Top Results From Across the Web
Why do some messages I send show twice, like I sent the ...
Try restarting the phone (turn it off and back on) sometimes that will help resolve it. Otherwise, if it continues for more than...
Read more >Why are my messages sending twice when texting? - Quora
You are located somewhere with a poor internet connection · Your phone is running out of juice and the message is stored locally...
Read more >Why did the person I sent a message to get duplicate ...
If you find duplicate messages sent within a few seconds of each other. This means that Twilio sent multiple messages to the carrier,...
Read more >How to Stop Sending Duplicate Text Messages on Android
How to Fix Duplicate Text Messages on Android · Turn Wi-Fi off and back on again. · Turn mobile data off and back...
Read more >Android sending double or duplicate text messages? You're ...
According to a report on Google's Issue Tracker, an individual shared logs of a bug that's causing GIFs to show up twice in...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The bot gets an event for its own message.
You should check whether the message author is the currently logged in account.
event.getMessage().getAuthor().equals(event.getJDA().getSelfUser())
It is also good practice to ignore messages from Users that are bot accountsUser#isBot()