Skip to content

Commit

Permalink
Hot-fix FreeCommand ignoring messages from guild
Browse files Browse the repository at this point in the history
After updating to JDA5, GuildMessageReceviedEvent was removed.
MessageReceivedEvent has to be used instead.

To "counter" this, one can use the isFromGuild method.

I use this method, but incorrect.
I should invert the if statemen; if the message is NOT from a guild, ignore.

This modification fixes the update that broke the help system.
  • Loading branch information
nltbee authored and Zabuzard committed Apr 14, 2022
1 parent d14a7bc commit bae7b79
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ public void onEvent(@NotNull GenericEvent event) {
if (event instanceof ReadyEvent readyEvent) {
onReady(readyEvent);
} else if (event instanceof MessageReceivedEvent messageEvent) {
if (messageEvent.isFromGuild()) {
if (!messageEvent.isFromGuild()) {
return;
}

Expand Down

0 comments on commit bae7b79

Please sign in to comment.