Closed AveCard1nal closed 8 months ago
On messages from context message commands, Message#getMember
is not null if the member is cached.
You can either enable the cache with MemberCachePolicy
and ChunkingFilter
, or, retrieve the member with Guild#retrieveMember
and passing Message#getAuthor
to it
Guild#retrieveMember has worked. Thank you!
General Troubleshooting
Version of JDA
5.0.0-beta.20
Expected Behaviour
Hello. Encountered an error in the onMessageContextInteraction event. When attempting to retrieve the author of the message (event.getTarget().getMember()), it returns null (called for a message in the Guild). However, the method works correctly if the author of the message is the same user that triggers the onMessageContextInteraction event.
Code Example for Reproduction Steps
Code for JDABuilder or DefaultShardManagerBuilder used
Exception or Error
No response