From 49567bc1a369048b72ef727673e5e7ac00196d52 Mon Sep 17 00:00:00 2001 From: Twentysix Date: Fri, 18 Nov 2016 01:57:29 +0100 Subject: [PATCH] [General, Owner] Properly catch perm exceptions for embeds --- cogs/general.py | 4 ++-- cogs/owner.py | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/cogs/general.py b/cogs/general.py index f49e64f18..5b8c67964 100644 --- a/cogs/general.py +++ b/cogs/general.py @@ -207,7 +207,7 @@ class General: try: await self.bot.say(embed=data) - except: + except discord.HTTPException: await self.bot.say("I need the `Embed links` permission " "to send this") @@ -249,7 +249,7 @@ class General: try: await self.bot.say(embed=data) - except: + except discord.HTTPException: await self.bot.say("I need the `Embed links` permission " "to send this") diff --git a/cogs/owner.py b/cogs/owner.py index fbdbb128d..c60662605 100644 --- a/cogs/owner.py +++ b/cogs/owner.py @@ -616,7 +616,11 @@ class Owner: embed.set_footer(text="Bringing joy since 02 Jan 2016 (over " "{} days ago!)".format(days_since)) - await self.bot.say(embed=embed) + try: + await self.bot.say(embed=embed) + except discord.HTTPException: + await self.bot.say("I need the `Embed links` permission " + "to send this") @commands.command() async def uptime(self): @@ -633,7 +637,7 @@ class Owner: result = await asyncio.wait_for(response, timeout=10) try: await self.bot.say(embed=result) - except: + except discord.HTTPException: await self.bot.say("I need the `Embed links` permission " "to send this")