Update delete scores to new HighscoresData class.

This commit is contained in:
alwayscompiling
2022-07-27 22:27:27 -04:00
parent 5b31314f02
commit beedf946c9
2 changed files with 19 additions and 11 deletions
+3 -11
View File
@@ -6,8 +6,8 @@ from nextcord import Embed
from nextcord.ext import commands
from highscores import highscores_data # pylint: disable=import-error
from utilities.data_storage import save_highscores_data # pylint: disable=import-error
from utilities.data_storage import create_highscore_skeleton # pylint: disable=import-error
from utilities.highscores_data import save_highscores_data # pylint: disable=import-error
from utilities.highscores_data import create_highscore_skeleton # pylint: disable=import-error
class DeleteScores(commands.Cog, name="Delete Scores"):
@@ -31,15 +31,7 @@ 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:
guild_data: dict = highscores_data[str(ctx.guild.id)]
for boss, boss_data in guild_data["tables"].items():
for category, category_data in boss_data["categories"].items():
category_data = []
boss_data["categories"][category] = category_data
guild_data["tables"][boss] = boss_data
save_highscores_data(highscores_data)
highscores_data.reset_guild_data(ctx.guild.id)
# This function will be called when this extension is loaded.