Skip to content

checking if a message mentions a specific user: problem with getMemberById and retrieveMemberById #2384

Discussion options

You must be logged in to vote

okay, I managed to solve it finally!
I had to add ".setMemberCachePolicy(ALL)" to the JDA builder in the Main function, I also am now making sure to retrieve the Member of my friend like this:

`@Override
public void onReady(ReadyEvent readyEvent) {

    readyEvent.getJDA().getGuildById(1001558016119816192L).retrieveMemberById(friendUserId, true).queue(member -> {
        System.out.println(readyEvent.getJDA().getGuildById(1001558016119816192L).getMemberById(friendUserId));
    }, new ErrorHandler().handle(ErrorResponse.UNKNOWN_MEMBER, error -> {
        System.out.println("bruhhhhhhhh friend wher");
    }));

}`

then later on getMember works just fine!

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@MinnDevelopment
Comment options

Answer selected by TheDartFrog
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants