invalid player handlign

This commit is contained in:
TheTechRobo 2021-06-06 16:38:43 -04:00
parent 3b02b703a6
commit 63600fc48b
1 changed files with 5 additions and 1 deletions

6
bot.py
View File

@ -2,6 +2,7 @@
import discord, requests, json, time
from discord.ext import commands
from hypixel_bot_tools import *
import hypixel_bot_tools.errors
# }}}
# {{{ Get token
try:
@ -57,7 +58,10 @@ async def hypixel(ctx,player,ConvertToUUID=True):
await ctx.send(_(":warning: Ran out of API queries per minute. Please wait a little while before continuing..."))
return False
thing = await ctx.send(_("Fetching player data... If this message doesn't go away, the bot is _definitely_ not broken. :soundsrightbud:"))
contents = overall(HYPIXEL_API_KEY,player,ConvertToUUID)
try:
contents = overall(HYPIXEL_API_KEY,player,ConvertToUUID)
except hypixel_bot_tools.errors.InvalidPlayer:
await thing.edit(content=_(":warning: Invalid player!"));raise
print(contents)
em = discord.Embed(
title=f"{contents['displayname']}'{_('s Hypixel Stats')}",