From dc8aa7c35b5e6399d6ed2dcde50eb59ab8abc744 Mon Sep 17 00:00:00 2001 From: MusicOnline <39178127+MusicOnline@users.noreply.github.com> Date: Sat, 22 Dec 2018 11:30:11 +0800 Subject: [PATCH] Change Greedy behaviour slightly during conversion errors. Make Greedy swallow conversion errors and return the default if there are no convertible args --- discord/ext/commands/core.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py index a45714b41..89ca1acf7 100644 --- a/discord/ext/commands/core.py +++ b/discord/ext/commands/core.py @@ -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):