-
-
Notifications
You must be signed in to change notification settings - Fork 470
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: KeyError when using method 'individual' #1925
Conversation
The variable cmd originates from the for-loop in line 602, if the method is not "bulk". Therefore the old code throws a KeyError Exception because the key `name` doesnt't exists. This breaks the method `individual` for syncing commands. Signed-off-by: Lukas Dobler <69309597+doluk@users.noreply.github.com>
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #1925 +/- ##
=======================================
Coverage 33.22% 33.22%
=======================================
Files 97 97
Lines 19092 19092
=======================================
Hits 6343 6343
Misses 12749 12749
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report in Codecov by Sentry.
|
Can you please provide an example of code that would cause the KeyError previously? |
Yes, I will post an example in a bit. Here is the non-code version:
|
Signed-off-by: Lukas Dobler <69309597+doluk@users.noreply.github.com>
I think it would be better if the name of the command was passed into |
@doluk please work on that, we want to get it finished <3 |
@Lulalaby @Middledot |
We know, all fine |
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.
Lgtm
Summary
Resolve the origin of the variable
cmd
inApplicationCommandMixin.register_commands()
and fix a bug in the same method when using the sync methodindividual
.Information
examples, ...).
Checklist
type: ignore
comments were used, a comment is also left explaining why.The variable cmd originates from the for-loop in line 602, if the method is not "bulk". Therefore the old code throws a
KeyError
-Exception, because the keyname
doesnt't exists.cmd
only has the keysaction
,command
andid
. This breaks the methodindividual
for syncing commands.