mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-22 08:44:10 +00:00
Change Greedy behaviour slightly during conversion errors.
Make Greedy swallow conversion errors and return the default if there are no convertible args
This commit is contained in:
parent
0614e2af90
commit
dc8aa7c35b
@ -359,22 +359,18 @@ class Command:
|
||||
# for use with a manual undo
|
||||
previous = view.index
|
||||
|
||||
# parsing errors get propagated
|
||||
view.skip_ws()
|
||||
argument = quoted_word(view)
|
||||
try:
|
||||
value = await self.do_conversion(ctx, converter, argument, param)
|
||||
except CommandError:
|
||||
if not result:
|
||||
if required:
|
||||
raise
|
||||
else:
|
||||
view.index = previous
|
||||
return param.default
|
||||
view.index = previous
|
||||
break
|
||||
else:
|
||||
result.append(value)
|
||||
|
||||
if not result and not required:
|
||||
return param.default
|
||||
return result
|
||||
|
||||
async def _transform_greedy_var_pos(self, ctx, param, converter):
|
||||
|
Loading…
x
Reference in New Issue
Block a user