checking if a message mentions a specific user: problem with getMemberById and retrieveMemberById #2384
-
hi! I wanna add that getMentionedMembers() on a message where I ping my friend prints the Member of my friend just fine, perhaps it would be possible to somehow hardcode the member then instead of getting it by ID? Earlier I was checking if 'getMentionedMembers().get(0).getIdLong()' matched the ID of my friend, but that of course only worked if my friend was the first one to be mentioned in the message, and I also didn't like the jankyness of that solution I also know I could just check if the message contains <@IdLongOfMyFriend> but that feels kinda janky as well, and it also doesn't account for example for reply mentions Please excuse me if the problem is very obvious and it's just me not understand something, I'm still learning! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
okay, I managed to solve it finally! `@Override
then later on getMember works just fine! |
Beta Was this translation helpful? Give feedback.
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) {
then later on getMember works just fine!