diff --git a/Cogs/ampa.py b/Cogs/ampa.py index 635c4167..93802af6 100644 --- a/Cogs/ampa.py +++ b/Cogs/ampa.py @@ -64,8 +64,7 @@ def check(m): logger.error(f"An error occurred: {e}") await ctx.send(f"An error occurred: {e}") - @staticmethod - def list_files(search_path: str = ".") -> list: + def list_files(self, search_path: str = ".") -> list: """List all file paths in the given directory and its subdirectories, ignoring package and cache files.""" file_paths = [] ignore_patterns = [ @@ -101,8 +100,7 @@ def list_files(search_path: str = ".") -> list: return file_paths - @staticmethod - async def send_file_to_user(user: discord.User, file_path: str): + async def send_file_to_user(self, user: discord.User, file_path: str): """Send a file to the specified user via DM, handling size limitations.""" try: filename = os.path.basename(file_path) diff --git a/Cogs/anime.py b/Cogs/anime.py index e6443ddd..6256635d 100644 --- a/Cogs/anime.py +++ b/Cogs/anime.py @@ -299,8 +299,7 @@ async def update_embed(self): return embed - @staticmethod - def get_image_url(images): + def get_image_url(self, images): size_order = ["large", "medium", "small"] for size in size_order: image_url = images.get("jpg", {}).get(f"{size}_image_url") @@ -484,8 +483,7 @@ async def update_embed(self): return embed - @staticmethod - def get_image_url(images): + def get_image_url(self, images): size_order = ["large", "medium", "small"] for size in size_order: image_url = images.get("jpg", {}).get(f"{size}_image_url") diff --git a/Cogs/help.py b/Cogs/help.py index 57059864..2945ab5d 100644 --- a/Cogs/help.py +++ b/Cogs/help.py @@ -378,8 +378,7 @@ def _draw_text(self, draw, text_x, text_y): fill=self.base_font_color, ) - @staticmethod - def _download_image(url): + def _download_image(self, url): """Download an image from a URL.""" response = requests.get(url) response.raise_for_status() # Ensure we notice bad responses @@ -513,8 +512,7 @@ def _load_resources(self): self._resize_character() - @staticmethod - def _download_image(url): + def _download_image(self, url): """Download an image from a URL and return it as a PIL Image.""" response = requests.get(url) response.raise_for_status() @@ -654,8 +652,7 @@ def _update_command_mapping(self): mapping[cog_name][cmd.name] = " " self._save_command_mapping(mapping) - @staticmethod - def format_cog_commands(cog_name, cog_commands, command_mapping): + def format_cog_commands(self, cog_name, cog_commands, command_mapping): embed = discord.Embed( title=f"Commands for {cog_name}", color=primary_color_value ) diff --git a/Cogs/information.py b/Cogs/information.py index bf8e42a7..14fb8d40 100644 --- a/Cogs/information.py +++ b/Cogs/information.py @@ -69,8 +69,7 @@ async def about(self, ctx, id: Union[discord.Member, int, str] = None): embed = await self.get_information_embed(id, self.bot) await ctx.reply(embed=embed, mention_author=False) - @staticmethod - async def get_information_embed(id, bot): + async def get_information_embed(self, id, bot): if isinstance(id, discord.Member): return await Information_Embed.get_member_embed(bot, id) elif isinstance(id, int): diff --git a/Cogs/memo.py b/Cogs/memo.py index f60381ed..f770e7db 100644 --- a/Cogs/memo.py +++ b/Cogs/memo.py @@ -83,15 +83,13 @@ async def play_emoji_game(self, ctx): except asyncio.TimeoutError: await message.edit(embed=self.timeout_embed(), view=None) - @staticmethod - def timeout_embed(): + def timeout_embed(self): return discord.Embed( title="Time's Up...", description="||```You didn't click the emoji in time.```||", ) - @staticmethod - def timestamp_gen(timestamp: int) -> str: + def timestamp_gen(self, timestamp: int) -> str: dt = datetime.utcfromtimestamp(timestamp).replace(tzinfo=timezone.utc) formatted_timestamp = f"" return formatted_timestamp @@ -403,8 +401,7 @@ async def handle_error(self, interaction, error, title): """Handles errors and sends a custom embed.""" await error_custom_embed(self.bot, interaction, str(error), title=title) - @staticmethod - async def validate_input(**kwargs): + async def validate_input(self, **kwargs): """Validates input values to ensure they are not None or empty.""" for key, value in kwargs.items(): if value is None or value == "": diff --git a/Cogs/pokemon.py b/Cogs/pokemon.py index 9031e07a..18fb3a1d 100644 --- a/Cogs/pokemon.py +++ b/Cogs/pokemon.py @@ -101,8 +101,7 @@ def process_image(self, path, filename): } self.cache[filename] = metadata - @staticmethod - def evaluate_image_quality(image): + def evaluate_image_quality(self, image): """Evaluates image quality based on sharpness.""" sharpness = cv.Laplacian(image, cv.CV_64F).var() return sharpness @@ -124,8 +123,7 @@ def cross_match(self, descriptors, image, k=2): return best_match, max_accuracy - @staticmethod - def evaluate_accuracy(matches): + def evaluate_accuracy(self, matches): """Evaluates accuracy based on good matches.""" good_matches = sum( 1 @@ -323,8 +321,7 @@ async def download_image(self, session, pokemon_name, semaphore): f"Image for {pokemon_name} already exists, skipping download." ) - @staticmethod - def remove_srgb_profile(img_path): + def remove_srgb_profile(self, img_path): try: with Image.open(img_path) as img: img.save(img_path, icc_profile=None) @@ -332,8 +329,7 @@ def remove_srgb_profile(img_path): except Exception as e: logger.error(f"Error removing sRGB profile: {e}") - @staticmethod - def ensure_correct_color_format(img): + def ensure_correct_color_format(self, img): """ Convert image to RGB format. """ @@ -344,8 +340,7 @@ def ensure_correct_color_format(img): return cv2.cvtColor(img, cv2.COLOR_RGBA2RGB) return img - @staticmethod - def download_file(url, filename): + def download_file(self, url, filename): response = urlopen(url) with open(filename, "wb") as f: f.write(response.read()) @@ -1722,8 +1717,7 @@ async def show_evolutions(self, interaction: discord.Interaction): f"Error fetching Pokémon evolution chain: {str(e)}", ephemeral=True ) - @staticmethod - async def get_pokemon_evolution_chain(pokemon_name): + async def get_pokemon_evolution_chain(self, pokemon_name): async with aiohttp.ClientSession() as session: species_url = ( f"https://pokeapi.co/api/v2/pokemon-species/{pokemon_name.lower()}/" @@ -1790,9 +1784,8 @@ async def display_evolution_chain(self, chain): return embeds - @staticmethod async def determine_evolution_method( - current_pokemon, evolution_details, next_pokemon + self, current_pokemon, evolution_details, next_pokemon ): trigger = evolution_details.get("trigger", {}).get("name") item = evolution_details.get("item") @@ -2019,9 +2012,8 @@ def __init__( def get_flag(self, lang): return self.flag_mapping.get(lang) - @staticmethod def get_pokemon_description( - pokemon_id, file_path="Data/pokemon/pokemon_description.csv" + self, pokemon_id, file_path="Data/pokemon/pokemon_description.csv" ): try: with open(file_path, mode="r", encoding="utf-8") as csv_file: @@ -2038,9 +2030,8 @@ def get_pokemon_description( return f"An error occurred: {e}" return "Pokémon ID not found" - @staticmethod def get_pokemon_region( - pokemon_id, file_path="Data/pokemon/pokemon_description.csv" + self, pokemon_id, file_path="Data/pokemon/pokemon_description.csv" ): try: with open(file_path, mode="r", encoding="utf-8") as csv_file: @@ -2314,8 +2305,7 @@ async def get_pokemon_moves(self): ) return moves_data - @staticmethod - async def fetch_move_details(move_url): + async def fetch_move_details(self, move_url): response = requests.get(move_url) if response.status_code == 200: move_data = response.json() diff --git a/Cogs/quest.py b/Cogs/quest.py index 56b05ed6..8c9439c1 100644 --- a/Cogs/quest.py +++ b/Cogs/quest.py @@ -397,8 +397,7 @@ async def shop(self, ctx): except Exception as e: await ctx.send(f"An error occurred while processing the shop: {e}") - @staticmethod - def read_shop_file(filename): + def read_shop_file(self, filename): with open(filename, "r", encoding="utf-8") as file: shop_data = json.load(file) return shop_data @@ -1030,8 +1029,7 @@ def _draw_text(self, draw, text_x, text_y): fill=self.base_font_color, ) - @staticmethod - def _download_image(url): + def _download_image(self, url): """Download an image from a URL.""" try: response = requests.get(url) @@ -1086,8 +1084,7 @@ def __init__(self, bot): async def handle_error(self, interaction, error, title): await error_custom_embed(self.bot, interaction, str(error), title=title) - @staticmethod - async def validate_input(**kwargs): + async def validate_input(self, **kwargs): for key, value in kwargs.items(): if value is None or value == "": raise ValueError(f"{key} cannot be None or empty") @@ -2672,8 +2669,7 @@ async def start(self, ctx): except Exception as e: await self.handle_error(ctx, e) - @staticmethod - async def handle_error(interaction, exception): + async def handle_error(self, interaction, exception): traceback_msg = "".join( traceback.format_exception( type(exception), exception, exception.__traceback__ diff --git a/Cogs/system.py b/Cogs/system.py index b1e36575..1bd382be 100644 --- a/Cogs/system.py +++ b/Cogs/system.py @@ -22,8 +22,7 @@ def __init__(self, bot): self.memory_check.start() self.image_file = "Data/commands/help/help_embed_images.json" - @staticmethod - async def get_latest_python_version(): + async def get_latest_python_version(self): latest_version = ( subprocess.check_output( [ @@ -82,8 +81,7 @@ async def ping(self, ctx): logger.error( f"[System cog] Error occurred while sending ping embed: {e}") - @staticmethod - def cog_unload(): + def cog_unload(self): logger.info(f"{Fore.RED}[System cog] Unloaded{Style.RESET_ALL}") @commands.command(name="uptime") @@ -119,8 +117,7 @@ def optimize_memory(self): self.bot._connection.clear() print(f"Optimized memory. Garbage collected: {collected} objects.") - @staticmethod - def log_memory_usage(): + def log_memory_usage(self): """Logs the bot's current memory usage.""" process = psutil.Process(os.getpid()) memory_info = process.memory_info() @@ -144,8 +141,7 @@ async def memory_info(self, ctx): memory_usage = self.get_memory_usage() await ctx.send(f"Current memory usage: {memory_usage:.2f} MB") - @staticmethod - def get_memory_usage(): + def get_memory_usage(self): """Returns the current memory usage of the bot.""" process = psutil.Process(os.getpid()) memory_info = process.memory_info() diff --git a/Data/pokemon/dataset.py b/Data/pokemon/dataset.py index d2324ead..c3e61e67 100644 --- a/Data/pokemon/dataset.py +++ b/Data/pokemon/dataset.py @@ -44,8 +44,7 @@ def __init__(self, db_file='Data/pokemon/pokemon_images.db', processed_file='Dat print(f"Initializing processed entries database at {self.processed_file}...") self._init_processed_db() - @staticmethod - def _db_connect(db_name): + def _db_connect(self, db_name): return sqlite3.connect(db_name) def _init_db(self): @@ -184,18 +183,15 @@ def _process_image(self, image_path): print(f"Error processing image {image_path}: {e}") return None - @staticmethod - def serialize_keypoints(keypoints): + def serialize_keypoints(self, keypoints): """Convert cv2.KeyPoint objects to a serializable format.""" return [{'pt': kp.pt, 'size': kp.size, 'angle': kp.angle, 'response': kp.response, 'octave': kp.octave, 'class_id': kp.class_id} for kp in keypoints] - @staticmethod - def deserialize_keypoints(serialized_keypoints): + def deserialize_keypoints(self, serialized_keypoints): """Convert serialized keypoints back to cv2.KeyPoint objects.""" return [cv2.KeyPoint(kp['pt'][0], kp['pt'][1], kp['size'], kp['angle'], kp['response'], kp['octave'], kp['class_id']) for kp in serialized_keypoints] - @staticmethod - def _clear_console(): + def _clear_console(self): os.system("cls" if os.name == "nt" else "clear") def _get_cache_items(self): diff --git a/Events/appearance.py b/Events/appearance.py index 6e76c42d..45f88bf6 100644 --- a/Events/appearance.py +++ b/Events/appearance.py @@ -178,8 +178,7 @@ async def update_grid_message(self, ctx, grid_index, total_pages): logger.error(f"An error occurred while updating grid message: {e}") raise - @staticmethod - async def update_grid_reactions(message, grid_index, total_pages): + async def update_grid_reactions(self, message, grid_index, total_pages): try: # Add reactions for image selection if there are any images if total_pages > 1: diff --git a/Events/code_logger.py b/Events/code_logger.py index 1a635e3b..86511e26 100644 --- a/Events/code_logger.py +++ b/Events/code_logger.py @@ -150,8 +150,7 @@ async def send_log_embed(self, message): await const.error_custom_embed(self.bot, None, e, title="Log Embed Error") # Method to send an embed message - @staticmethod - async def send_embed(channel, title, description): + async def send_embed(self, channel, title, description): embed = discord.Embed( title=title, description=description, @@ -164,15 +163,13 @@ async def send_embed(channel, title, description): await channel.send(embed=embed) # Method to send a file - @staticmethod - async def send_file(channel, file_path, title, description): + async def send_file(self, channel, file_path, title, description): with open(file_path, "w") as file: file.write(description) await channel.send(file=discord.File(file_path), content=f"**{title}**") # Method to get updated commands - @staticmethod - async def get_updated_commands(): + async def get_updated_commands(self): root_dir = os.getcwd() repo = Repo(root_dir) diff = repo.head.commit.diff(None) diff --git a/Events/poketwo_anti_thief.py b/Events/poketwo_anti_thief.py index 1d5a871d..8a7e7342 100644 --- a/Events/poketwo_anti_thief.py +++ b/Events/poketwo_anti_thief.py @@ -123,8 +123,7 @@ def __init__(self, bot, anti_thief=None): self.shiny_ping_phrase = load_ping_phrase() - @staticmethod - def timestamp_gen(timestamp: int) -> str: + def timestamp_gen(self, timestamp: int) -> str: dt = datetime.datetime.utcfromtimestamp(timestamp).replace(tzinfo=datetime.timezone.utc) return f'' @@ -280,16 +279,14 @@ async def process_congratulations(self, congrats_message, original_message, refe logger.error(f"Unexpected error in process_congratulations: {e}") traceback.print_exc() - @staticmethod - async def allow_all_to_catch(message): + async def allow_all_to_catch(self, message): embed = message.embeds[0] embed.description = "✅ Everyone may catch the Pokémon now! No restrictions." embed.color = 0x00FF00 await message.edit(embed=embed) logger.info("Everyone is allowed to catch the Pokémon now.") - @staticmethod - async def timeout_user(user, message): + async def timeout_user(self, user, message): BOT_TOKEN = os.getenv("TOKEN") GUILD_ID = message.guild.id USER_ID = user.id @@ -315,8 +312,7 @@ async def timeout_user(user, message): else: logger.error(f"Failed to timeout user {user.mention}: {response.status_code}") - @staticmethod - async def delete_embed_on_catch(message): + async def delete_embed_on_catch(self, message): try: await message.delete() logger.info("Embed deleted after successful catch.") diff --git a/Subcogs/information.py b/Subcogs/information.py index 99dadbc0..735443ce 100644 --- a/Subcogs/information.py +++ b/Subcogs/information.py @@ -124,8 +124,7 @@ def __init__(self, bot): self.afk_file_path = "Caster-Bot/Caster-main/afk_members.json" - @staticmethod - async def fetch_invites(guild): + async def fetch_invites(self, guild): return await guild.invites() async def update_invites(self, guild): @@ -157,15 +156,13 @@ async def get_inviter_mention(self, member): return inviter_mention - @staticmethod - async def get_avatar_emoji(ctx, member): + async def get_avatar_emoji(self, ctx, member): if member.bot: return "🤖" # Bot emoji else: return "👤" # Member emoji - @staticmethod - def timestamp_gen(timestamp: int) -> str: + def timestamp_gen(self, timestamp: int) -> str: dt = datetime.utcfromtimestamp(timestamp).replace(tzinfo=timezone.utc) formatted_timestamp = f"" return formatted_timestamp @@ -664,8 +661,7 @@ async def list_members(self, ctx, *, filter_option: str = None): await ctx.send(error_message) print(f"Error encountered: {traceback.format_exc()}") - @staticmethod - def get_usage_guide(): + def get_usage_guide(self): return ( "Usage: \n" ",members --filter \n" @@ -680,8 +676,7 @@ def get_usage_guide(): "```" ) - @staticmethod - def apply_filter(all_members, filter_option): + def apply_filter(self, all_members, filter_option): if filter_option == FilterOption.NEWEST_TO_OLDEST.value: all_members = sorted( all_members, key=lambda member: member.joined_at, reverse=True @@ -752,8 +747,7 @@ async def create_member_embeds( return embeds - @staticmethod - async def fetch_avatar_data(member): + async def fetch_avatar_data(self, member): try: async with aiohttp.ClientSession() as session: async with session.get(str(member.avatar.with_size(128))) as resp: @@ -766,8 +760,7 @@ async def fetch_avatar_data(member): print(f"Error fetching avatar for {member.display_name}: {e}") return None - @staticmethod - def concatenate_images(row_images): + def concatenate_images(self, row_images): total_width = sum(img.width for img in row_images) max_height = max(img.height for img in row_images) concatenated_image = Image.new("RGB", (total_width, max_height)) @@ -782,9 +775,8 @@ def concatenate_images(row_images): temp_file.seek(0) # Reset the position of the file cursor return temp_file - @staticmethod def add_member_info_to_embed( - embed, member, emoji, joined_timestamp, filter_option + self, embed, member, emoji, joined_timestamp, filter_option ): # Add the member's display name and roles to the embed embed.add_field( diff --git a/storage/pokemon.py b/storage/pokemon.py index 6e88e4b5..bb75b92b 100644 --- a/storage/pokemon.py +++ b/storage/pokemon.py @@ -121,8 +121,7 @@ def load_from_images(self): print(f"Images loaded in {time.time() - start_time:.2f} seconds") - @staticmethod - def _find_image_inside_image(img, template): + def _find_image_inside_image(self, img, template): img_gray = cv.cvtColor(img, cv.COLOR_BGR2GRAY) template_gray = cv.cvtColor(template, cv.COLOR_BGR2GRAY) @@ -232,8 +231,7 @@ def predict_pokemon(self, img): return "No Pokémon detected", round(time.time() - start_time, 2) - @staticmethod - def load_image_from_url(url): + def load_image_from_url(self, url): try: response = requests.get(url) response.raise_for_status() @@ -326,8 +324,7 @@ async def download_image(self, session, pokemon_name, semaphore): f"Image for {pokemon_name} already exists, skipping download." ) - @staticmethod - def remove_srgb_profile(img_path): + def remove_srgb_profile(self, img_path): try: with Image.open(img_path) as img: img.save(img_path, icc_profile=None) @@ -335,8 +332,7 @@ def remove_srgb_profile(img_path): except Exception as e: logger.error(f"Error removing sRGB profile: {e}") - @staticmethod - def ensure_correct_color_format(img): + def ensure_correct_color_format(self, img): """ Convert image to RGB format. """ @@ -347,8 +343,7 @@ def ensure_correct_color_format(img): return cv2.cvtColor(img, cv2.COLOR_RGBA2RGB) return img - @staticmethod - def download_file(url, filename): + def download_file(self, url, filename): response = urlopen(url) with open(filename, "wb") as f: f.write(response.read()) @@ -1586,8 +1581,7 @@ async def show_evolutions(self, interaction: discord.Interaction): f"Error fetching Pokémon evolution chain: {str(e)}", ephemeral=True ) - @staticmethod - async def get_pokemon_evolution_chain(pokemon_name): + async def get_pokemon_evolution_chain(self, pokemon_name): async with aiohttp.ClientSession() as session: species_url = ( f"https://pokeapi.co/api/v2/pokemon-species/{pokemon_name.lower()}/" @@ -1654,9 +1648,8 @@ async def display_evolution_chain(self, chain): return embeds - @staticmethod async def determine_evolution_method( - current_pokemon, evolution_details, next_pokemon + self, current_pokemon, evolution_details, next_pokemon ): trigger = evolution_details.get("trigger", {}).get("name") item = evolution_details.get("item") @@ -1883,9 +1876,8 @@ def __init__( def get_flag(self, lang): return self.flag_mapping.get(lang) - @staticmethod def get_pokemon_description( - pokemon_id, file_path="Data/pokemon/pokemon_description.csv" + self, pokemon_id, file_path="Data/pokemon/pokemon_description.csv" ): try: with open(file_path, mode="r", encoding="utf-8") as csv_file: @@ -1902,9 +1894,8 @@ def get_pokemon_description( return f"An error occurred: {e}" return "Pokémon ID not found" - @staticmethod def get_pokemon_region( - pokemon_id, file_path="Data/pokemon/pokemon_description.csv" + self, pokemon_id, file_path="Data/pokemon/pokemon_description.csv" ): try: with open(file_path, mode="r", encoding="utf-8") as csv_file: @@ -2178,8 +2169,7 @@ async def get_pokemon_moves(self): ) return moves_data - @staticmethod - async def fetch_move_details(move_url): + async def fetch_move_details(self, move_url): response = requests.get(move_url) if response.status_code == 200: move_data = response.json() diff --git a/storage/predict.py b/storage/predict.py index 1562c026..11019bbd 100644 --- a/storage/predict.py +++ b/storage/predict.py @@ -121,8 +121,7 @@ def cache_flipped_image(self, img, filename): descriptors # Store distances for future use ) - @staticmethod - def compute_roi_density(img): + def compute_roi_density(self, img): gray = cv.cvtColor(img, cv.COLOR_BGR2GRAY) density = cv.countNonZero(gray) / (gray.shape[0] * gray.shape[1]) return density @@ -191,8 +190,7 @@ async def predict_pokemon(self, img): # Changed to async return "No match found", time.time() - start_time - @staticmethod - def load_image_from_url(url): + def load_image_from_url(self, url): try: img = np.asarray( bytearray(requests.get(url).content), dtype=np.uint8) @@ -201,8 +199,7 @@ def load_image_from_url(url): print(f"Error fetching image from URL: {e}") return None - @staticmethod - def evaluate_matches(matches, filename): + def evaluate_matches(self, matches, filename): """Evaluate the matches and return the accuracy.""" if not matches: return 0 # No matches found, accuracy is 0 @@ -354,8 +351,7 @@ async def download_image(self, session, pokemon_name, semaphore): f"Image for {pokemon_name} already exists, skipping download." ) - @staticmethod - def remove_srgb_profile(img_path): + def remove_srgb_profile(self, img_path): try: with Image.open(img_path) as img: img.save(img_path, icc_profile=None) @@ -363,8 +359,7 @@ def remove_srgb_profile(img_path): except Exception as e: logger.error(f"Error removing sRGB profile: {e}") - @staticmethod - def ensure_correct_color_format(img): + def ensure_correct_color_format(self, img): """ Convert image to RGB format. """ @@ -375,8 +370,7 @@ def ensure_correct_color_format(img): return cv2.cvtColor(img, cv2.COLOR_RGBA2RGB) return img - @staticmethod - def download_file(url, filename): + def download_file(self, url, filename): response = urlopen(url) with open(filename, "wb") as f: f.write(response.read()) @@ -1785,8 +1779,7 @@ async def show_evolutions(self, interaction: discord.Interaction): f"Error fetching Pokémon evolution chain: {str(e)}", ephemeral=True ) - @staticmethod - async def get_pokemon_evolution_chain(pokemon_name): + async def get_pokemon_evolution_chain(self, pokemon_name): async with aiohttp.ClientSession() as session: species_url = ( f"https://pokeapi.co/api/v2/pokemon-species/{pokemon_name.lower()}/" @@ -1853,9 +1846,8 @@ async def display_evolution_chain(self, chain): return embeds - @staticmethod async def determine_evolution_method( - current_pokemon, evolution_details, next_pokemon + self, current_pokemon, evolution_details, next_pokemon ): trigger = evolution_details.get("trigger", {}).get("name") item = evolution_details.get("item") @@ -2082,9 +2074,8 @@ def __init__( def get_flag(self, lang): return self.flag_mapping.get(lang) - @staticmethod def get_pokemon_description( - pokemon_id, file_path="Data/pokemon/pokemon_description.csv" + self, pokemon_id, file_path="Data/pokemon/pokemon_description.csv" ): try: with open(file_path, mode="r", encoding="utf-8") as csv_file: @@ -2101,9 +2092,8 @@ def get_pokemon_description( return f"An error occurred: {e}" return "Pokémon ID not found" - @staticmethod def get_pokemon_region( - pokemon_id, file_path="Data/pokemon/pokemon_description.csv" + self, pokemon_id, file_path="Data/pokemon/pokemon_description.csv" ): try: with open(file_path, mode="r", encoding="utf-8") as csv_file: @@ -2377,8 +2367,7 @@ async def get_pokemon_moves(self): ) return moves_data - @staticmethod - async def fetch_move_details(move_url): + async def fetch_move_details(self, move_url): response = requests.get(move_url) if response.status_code == 200: move_data = response.json()