fix: KeyError when using method 'individual'#1925
fix: KeyError when using method 'individual'#1925Lulalaby merged 10 commits intoPycord-Development:masterfrom
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 |
Summary
Resolve the origin of the variable
cmdinApplicationCommandMixin.register_commands()and fix a bug in the same method when using the sync methodindividual.Information
examples, ...).
Checklist
type: ignorecomments 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 keynamedoesnt't exists.cmdonly has the keysaction,commandandid. This breaks the methodindividualfor syncing commands.