Repository navigation
fix(purge): fetch using target member instead of reading the member cache - #1531
Merged
Zabuzard merged 1 commit intoNov 19, 2026
Merged
Conversation
Tais993
approved these changes
Nov 18, 2026
Tais993
left a comment
Member
There was a problem hiding this comment.
as retrieveMemberById checks the cache first, and only retrieves when actually needed this is a slight improvement for cases where the Member, for some reason is not actually cached.
Additionally, InteractionEvent#editMessage can only be ran once, by using the Hook it can run multiple times. While that doesn't happen yet, it could be something that can be changed in the future so this is ig slightly better?
But at the same time, I don't think this was ever an issue as all members are cached, and same for the edit hook, it was never an issue before. But the code is already there, so I don't see any issues with it?
Zabuzard
force-pushed
the
fix-purge-commands
branch
from
November 19, 2026 08:07
a790dac to
5c723b7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull-request
Changes
Closes Issue: NaN
Description
The
/purge-messages-by-userslash command always failed with the error message "That user is not a member of this guild." because it looked the target up viaGuild#getMember. This is a cache-only lookup.Now the slash command takes the member from OptionMapping#getAsMember, which JDA builds from the interaction's resolved payload and therefore works for uncached members at no extra REST cost.
The confirm button has no resolved data, so it fetches via Guild#retrieveMemberById, deferring the edit first so the fetch cannot blow the interaction ack window, and the follow-up edits go through the interaction hook.