From 46de508e9f0c6d0287614dcacf70d27d990d989a Mon Sep 17 00:00:00 2001 From: Kaveen Kumarasinghe Date: Mon, 19 Dec 2022 00:33:26 -0500 Subject: [PATCH] add help text for discord bug --- cogs/image_prompt_optimizer.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/cogs/image_prompt_optimizer.py b/cogs/image_prompt_optimizer.py index ebd9575..89fa51d 100644 --- a/cogs/image_prompt_optimizer.py +++ b/cogs/image_prompt_optimizer.py @@ -51,6 +51,16 @@ class ImgPromptOptimizer(commands.Cog, name="ImgPromptOptimizer"): traceback.print_exc() self.OPTIMIZER_PRETEXT = self._OPTIMIZER_PRETEXT + # Command error handler + @commands.Cog.listener() + async def on_command_error(self, ctx, error): + if isinstance(error, commands.CommandNotFound): + return + elif isinstance(error, commands.InvalidEndOfQuotedStringError): + await ctx.reply("There was an error while parsing your input. Please ensure that all quotation marks are closed and there is a space after the last quotation mark") + raise error + + @commands.command() async def imgoptimize(self, ctx, *args):