From 925a05aafb0c52b5fceef869d089f07fd0303e9e Mon Sep 17 00:00:00 2001 From: 0x5c Date: Mon, 20 Jan 2020 03:49:03 -0500 Subject: [PATCH] Mini-fix: extraneous warning emoji reaction on messages starting with "??" - also taken care of: "?!" --- CHANGELOG.md | 1 + main.py | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8f1c864..d4de433 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Fixed - Fixed ditto marks (") appearing in the ae7q call command. - Fixed issue where incorrect table was parsed in ae7q call command. +- Fixed warning emoji reaction on messages starting with "??". ## [2.1.0] - 2020-01-04 diff --git a/main.py b/main.py index dbce811..01ddb0b 100644 --- a/main.py +++ b/main.py @@ -164,8 +164,11 @@ async def on_command_error(ctx: commands.Context, err: commands.CommandError): if isinstance(err, commands.UserInputError): await cmn.add_react(ctx.message, cmn.emojis.warning) await ctx.send_help(ctx.command) - elif isinstance(err, commands.CommandNotFound) and not ctx.invoked_with.startswith("?"): - await cmn.add_react(ctx.message, cmn.emojis.question) + elif isinstance(err, commands.CommandNotFound): + if ctx.invoked_with.startswith(("?", "!")): + return + else: + await cmn.add_react(ctx.message, cmn.emojis.question) elif isinstance(err, commands.CheckFailure): # Add handling of other subclasses of CheckFailure as needed. if isinstance(err, commands.NotOwner):