From 650f1fa839b9706e9bfcd9d0fe3222c089bae965 Mon Sep 17 00:00:00 2001 From: phxntxm Date: Sat, 4 Mar 2017 01:51:30 -0600 Subject: [PATCH] Catch exception when the result of debug is too long --- cogs/owner.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cogs/owner.py b/cogs/owner.py index 3498c09..3a568ad 100644 --- a/cogs/owner.py +++ b/cogs/owner.py @@ -56,8 +56,12 @@ class Owner: except Exception as e: await self.bot.say(python.format(type(e).__name__ + ': ' + str(e))) return - - await self.bot.say(python.format(result)) + try: + await self.bot.say(python.format(result)) + except discord.HTTPException: + await self.bot.say("Result is too long for me to send") + except: + pass @commands.command(pass_context=True) @commands.check(utils.is_owner)