Issue
I'm making discord bot and i need make a commands like "kick" but JDA has only MessageReceiveEvent. I checked in docs and its says in jda has GuildMessageReceiveEvent but code only says about MessageReceivedEvent.
Solution
GuildMessageReceiveEvent has been removed and replaced by MessageReceivedEvent in JDA 5+. To only handle guild messages you just check event.isFromGuild() in your event:
public void onMessageReceived(MessageReceivedEvent event) {
if (!event.isFromGuild()) return;
...
}
Answered By - Minn
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.