Browse Source

Fix _get_command_error improperly handling some error messages

pull/9932/head
Pipythonmc 7 months ago
committed by GitHub
parent
commit
a183a56dd9
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 6
      discord/app_commands/errors.py

6
discord/app_commands/errors.py

@ -485,6 +485,10 @@ def _get_command_error(
if key == 'options':
for index, d in remaining.items():
_get_command_error(index, d, children, messages, indent=indent + 2)
elif key == '_errors':
errors = [x.get('message', '') for x in remaining]
messages.extend(f'{indentation} {message}' for message in errors)
else:
if isinstance(remaining, dict):
try:
@ -493,8 +497,6 @@ def _get_command_error(
errors = _flatten_error_dict(remaining, key=key)
else:
errors = {key: ' '.join(x.get('message', '') for x in inner_errors)}
else:
errors = _flatten_error_dict(remaining, key=key)
messages.extend(f'{indentation} {k}: {v}' for k, v in errors.items())

Loading…
Cancel
Save