Browse Source

[commands] Make Greedy ignore parsing errors.

pull/2481/head
Rapptz 6 years ago
parent
commit
1179df7e29
  1. 8
      discord/ext/commands/core.py

8
discord/ext/commands/core.py

@ -500,10 +500,10 @@ class Command(_BaseCommand):
previous = view.index
view.skip_ws()
argument = view.get_quoted_word()
try:
argument = view.get_quoted_word()
value = await self.do_conversion(ctx, converter, argument, param)
except CommandError:
except (CommandError, ArgumentParsingError):
view.index = previous
break
else:
@ -516,10 +516,10 @@ class Command(_BaseCommand):
async def _transform_greedy_var_pos(self, ctx, param, converter):
view = ctx.view
previous = view.index
argument = view.get_quoted_word()
try:
argument = view.get_quoted_word()
value = await self.do_conversion(ctx, converter, argument, param)
except CommandError:
except (CommandError, ArgumentParsingError):
view.index = previous
raise RuntimeError() from None # break loop
else:

Loading…
Cancel
Save