2
0
mirror of https://github.com/Nick80835/microbot synced 2025-08-31 14:38:04 +00:00

handle unavailable pokemon sprites

This commit is contained in:
Nick80835
2020-06-17 20:52:05 -04:00
parent 4113ac144f
commit b18a2a9443

View File

@@ -51,7 +51,11 @@ async def pokemon_image(event):
else:
await event.reply(f"An error occurred: **{response.status}**")
return
if not sprite_url:
await event.reply("That Pokémon config doesnt have an available sprite!")
return
async with ldr.aioclient.get(sprite_url) as response:
if response.status == 200:
sprite_io = await response.read()