Skip to content

Commit

Permalink
[commands] handle CustomDefault in Greedy converter
Browse files Browse the repository at this point in the history
[khazhyk: removed list handling, adjusted message]
  • Loading branch information
Sairam Kumar authored and khazhyk committed Apr 19, 2021
1 parent 1fe24c9 commit 40c234c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions discord/ext/commands/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ async def _transform_greedy_pos(self, ctx, param, required, converter):
result.append(value)

if not result and not required:
return param.default
return await self._resolve_default(ctx, param)
return result

async def _transform_greedy_var_pos(self, ctx, param, converter):
Expand All @@ -723,7 +723,7 @@ async def _transform_greedy_var_pos(self, ctx, param, converter):
view.index = previous
raise RuntimeError() from None # break loop
else:
return value
return value or await self._resolve_default(ctx, param)

@property
def clean_params(self) -> Dict[str, inspect.Parameter]:
Expand Down

0 comments on commit 40c234c

Please sign in to comment.