From 3e8e197eed8d68a939183f5184ef7159109e42ad Mon Sep 17 00:00:00 2001 From: Helixu Date: Wed, 24 Nov 2021 17:30:00 +0000 Subject: [PATCH] Added fail message to fox command when it 413's --- bot.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/bot.py b/bot.py index 68e1d1a..56fbdfe 100644 --- a/bot.py +++ b/bot.py @@ -40,7 +40,15 @@ async def fox(ctx): async with aiohttp.ClientSession() as session: async with session.get('https://foxrudor.de/') as resp: file = File(io.BytesIO(await resp.read()),filename='fox.jpg') - await ctx.send(random.choice(foxmsgs),file=file) + try: + await ctx.send(random.choice(foxmsgs),file=file) + except: + embed = discord.Embed( + title = "Command 'fox' failed", + description = "An error has occured with this command. This error is usually a 413 (Payload too large) and can be ignored." + ) + return await ctx.send(embed = embed) + @bot.command(brief="give someone a cuddle") async def hug(ctx, *, name=None): if not name: