Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit bae7b79

Browse files
nltbeeZabuzard
nltbee
authored andcommittedApr 14, 2022
Hot-fix FreeCommand ignoring messages from guild
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.
1 parent d14a7bc commit bae7b79

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎application/src/main/java/org/togetherjava/tjbot/commands/free/FreeCommand.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ public void onEvent(@NotNull GenericEvent event) {
295295
if (event instanceof ReadyEvent readyEvent) {
296296
onReady(readyEvent);
297297
} else if (event instanceof MessageReceivedEvent messageEvent) {
298-
if (messageEvent.isFromGuild()) {
298+
if (!messageEvent.isFromGuild()) {
299299
return;
300300
}
301301

0 commit comments

Comments
 (0)
Please sign in to comment.