You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The [p]ccrole add code is designed to exit the command early on role picking steps if a role could not be found but NONE is not explicitly passed. However, this catch can never happen, as there is an incorrect if statement.
# "Borrowed" from discord.ext.commands.Command._transform_greedy_pos
result= []
whilenotview.eof:
# for use with a manual undo
previous=view.index
view.skip_ws()
try:
argument=view.get_quoted_word()
value=awaitrc.convert(ctx, argument)
except (CommandError, ArgumentParsingError):
view.index=previous
break
else:
result.append(value)
return [r.idforrinresult]
There is only one return in this function, and it is the last line unindented, so there are no implicit None returns. It always returns a list, so the return value can never be None.
To Reproduce
Load cog ccrole
Run command [p]ccrole add
On a step that requests a role, enter an invalid role name
Expected behavior
The response "Invalid answer, canceling"
Screenshots or Error Messages
The text was updated successfully, but these errors were encountered:
Describe the bug
The
[p]ccrole add
code is designed to exit the command early on role picking steps if a role could not be found butNONE
is not explicitly passed. However, this catch can never happen, as there is an incorrectif
statement.Fox-V3/ccrole/ccrole.py
Lines 126 to 127 in 771d145
The
if
checks if the result from_get_roles_from_content
is None
, however that function can never returnNone
.Fox-V3/ccrole/ccrole.py
Lines 16 to 37 in 771d145
There is only one
return
in this function, and it is the last line unindented, so there are no implicitNone
returns. It always returns a list, so the return value can never beNone
.To Reproduce
ccrole
[p]ccrole add
Expected behavior
The response
"Invalid answer, canceling"
Screenshots or Error Messages
The text was updated successfully, but these errors were encountered: