moved pokedex into its own cog
This commit is contained in:
parent
84ee8f11d6
commit
90acde7e28
2 changed files with 9 additions and 58 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue