Added fail message to fox command when it 413's
This commit is contained in:
parent
2288581903
commit
3e8e197eed
1 changed files with 9 additions and 1 deletions
10
bot.py
10
bot.py
|
@ -40,7 +40,15 @@ async def fox(ctx):
|
||||||
async with aiohttp.ClientSession() as session:
|
async with aiohttp.ClientSession() as session:
|
||||||
async with session.get('https://foxrudor.de/') as resp:
|
async with session.get('https://foxrudor.de/') as resp:
|
||||||
file = File(io.BytesIO(await resp.read()),filename='fox.jpg')
|
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")
|
@bot.command(brief="give someone a cuddle")
|
||||||
async def hug(ctx, *, name=None):
|
async def hug(ctx, *, name=None):
|
||||||
if not name:
|
if not name:
|
||||||
|
|
Loading…
Reference in a new issue