diff --git a/cogs/delete_scores/__init__.py b/cogs/delete_scores/__init__.py index c7a4011..1d4e105 100644 --- a/cogs/delete_scores/__init__.py +++ b/cogs/delete_scores/__init__.py @@ -29,7 +29,9 @@ class DeleteScores(commands.Cog, name="Delete Scores"): # only allow AlwaysCompiling to use. # If you are a developer and want to use command, can add name to list if ctx.author.id == 206602713511886849: - highscores_data.reset_guild_data(ctx.guild.id) + for table in highscores_data.get_guild(ctx.guild.id).tables: + for category in table.categories: + category.clear() # This function will be called when this extension is loaded. diff --git a/data/highscores_data.py b/data/highscores_data.py index 8142239..387cb1e 100644 --- a/data/highscores_data.py +++ b/data/highscores_data.py @@ -57,6 +57,18 @@ class HighscoresData: guild: Guild = Guild(guild_id) self._guild_map[guild_id] = guild + def get_guild(self, guild_id: int) -> Guild: + """ + Getter for Guild object that corresponds with the guild_id. + + Args: + guild_id (int): id of Guild to retrieve. + + Returns: + Guild: Guild object for guild_id + """ + return self._guild_map[guild_id] + def remove_guild(self, guild_id: int) -> None: """ Removes a guild's data from object. Saves backup.