-
-
Notifications
You must be signed in to change notification settings - Fork 467
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: cog can still be MISSING #2313
Conversation
I have missed a part of code, yes, but your changes affect the logic too. Will review shortly. |
MISSING, | ||
None, | ||
) | ||
if match_ is not MISSING and _check_command(subcommand, match_): | ||
if match_ and _check_command(subcommand, match_): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this has anything to do with the cog attribute being MISSING, the MISSING value here is used for matching commands.
@@ -298,17 +295,15 @@ def _check_command(cmd: ApplicationCommand, match: Mapping[str, Any]) -> bool: | |||
falsy_vals = (False, []) | |||
for opt in value: | |||
cmd_vals = ( | |||
[val.get(opt, MISSING) for val in as_dict[check]] | |||
[val.get(opt) for val in as_dict[check]] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neither as_dict
nor to_check
will ever contain cog
in this chunk of the code. I don't understand how this fixes the issue, MISSING was again used for matching commands.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’ll need to test this more. Earlier when I had accidentally inverted the logic, it fixed the issue with non-cog commands, but now when properly treating None as a drop in replacement for MISSING it's again not retrieving options.
Co-authored-by: Dorukyum <[email protected]> Signed-off-by: Chris Oelerich <[email protected]>
It seems your thesis was wrong and I'm fixing the actual issue in a different pull request. Thanks anyway. |
Summary
#2303 partially changed checks of
MISSING
toNone
with the assumption that cog would never beMISSING
. Cog isMISSING
for commands instantiated from@bot.slash_command()
.Information
examples, ...).
Checklist
type: ignore
comments were used, a comment is also left explaining why.