Skip to content

Commit adac1de

Browse files
committed
Invalid arguments are now properly catched and a proper error message is sent (BadUnionArg)
1 parent 0c49598 commit adac1de

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ however, insignificant breaking changes do not guarantee a major version bump, s
2020
- UnicodeEncodeError will no longer be raised on Windows. ([PR #3043](https://github.com/kyb3r/modmail/pull/3043))
2121
- Notifications are no longer duplicated when using both `?notify` and `subscribe`. ([PR #3015](https://github.com/kyb3r/modmail/pull/3015))
2222
- `?contact` now works properly with both category and silent. ([GH #3076](https://github.com/kyb3r/modmail/issues/3076))
23-
- Resolves `close_on_leave_reason` not properly working when `close_on_leave` is enabled. ([GH #3075](https://github.com/kyb3r/modmail/issues/3075))
23+
- `close_on_leave_reason` now works properly when `close_on_leave` is enabled. ([GH #3075](https://github.com/kyb3r/modmail/issues/3075))
24+
- Invalid arguments are now properly catched and a proper error message is sent.
2425

2526
## Internal
2627

bot.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1472,7 +1472,7 @@ async def on_error(self, event_method, *args, **kwargs):
14721472
logger.error("Unexpected exception:", exc_info=sys.exc_info())
14731473

14741474
async def on_command_error(self, context, exception):
1475-
if isinstance(exception, commands.BadArgument):
1475+
if isinstance(exception, (commands.BadArgument, commands.BadUnionArgument)):
14761476
await context.trigger_typing()
14771477
await context.send(embed=discord.Embed(color=self.error_color, description=str(exception)))
14781478
elif isinstance(exception, commands.CommandNotFound):

0 commit comments

Comments
 (0)