moved pokedex into its own cog

This commit is contained in:
phixxy 2024-01-28 22:39:43 -08:00
parent 84ee8f11d6
commit 90acde7e28
2 changed files with 9 additions and 58 deletions

View file

@ -2,6 +2,10 @@ from discord.ext import commands
import discord
class Pokedex(commands.Cog):
def __init__(self, bot) -> None:
self.bot = bot
async def get_json(self, url):
async with self.bot.http_session.get(url) as resp:
json_data = await resp.json()
@ -60,6 +64,7 @@ class Pokedex(commands.Cog):
embed.set_footer(text=footer)
await ctx.send(embed=embed)
except:
self.bot.logger.exception("Something went wrong in pokedex")
message = "No data for " + str(pokemon)
await ctx.channel.send(message)