Search code examples
javadiscorddiscord4j

I have a Problem with Discord4Js MemberJoinEvent


I just started programming a new Discord bot for myself to see what I am able to create. Currently, I'm working on an Autorole feature but I just don't get why the Bot doesn't get triggered by a MemberJoinEvent. Here is my code:

gateway.getEventDispatcher().on(MemberJoinEvent.class).subscribe(memberJoinEvent -> {
       final Member member = memberJoinEvent.getMember();            
       System.out.println(member.toString());
});

Solution

  • I found the problem! I didnt know that discord changed something in their developer portal. Also I used my old project so I didnt notice it. You have to manualy enable it in the developer portal, that the bot can access member information. A screenshot of the location to enable the gateway feature