From dac2f68f80b8593a37a78f835a70037ec2094a18 Mon Sep 17 00:00:00 2001 From: phixxy Date: Sun, 4 Feb 2024 00:23:06 -0800 Subject: [PATCH] fixed get_json function call --- extensions/pokemon.py | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/extensions/pokemon.py b/extensions/pokemon.py index 2f66679..f4b1559 100644 --- a/extensions/pokemon.py +++ b/extensions/pokemon.py @@ -8,19 +8,6 @@ import math import time - -#@commands.cooldown(1, 60, commands.BucketType.user) Cooldowns.... - -class Pokemon: - async def __init__(self, id: int, generate: bool = True) -> None: - if generate: # Should I even do it this way? - self.json_data = await self.get_pkmn_from_id(id) - - async def get_pkmn_from_id(id): - url = 'https://pokeapi.co/api/v2/pokemon/' + str(id) - json_data = await self.get_json(url) - return json_data - class PokemonGame(commands.Cog): def __init__(self, bot): @@ -45,7 +32,7 @@ class PokemonGame(commands.Cog): async def starter_picker(self, id): #id = pokedex number url = "https://pokeapi.co/api/v2/pokemon-species/" + str(id) - json_data = await get_json(url) + json_data = await self.get_json(url) if (json_data["evolves_from_species"] == None) and (not json_data['is_mythical']) and (not json_data['is_legendary']): return True else: