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:
MusicOnline 2018-12-22 11:30:11 +08:00 committed by Rapptz
parent 0614e2af90
commit dc8aa7c35b

View File

@ -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):