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
+16
View File
@@ -149,6 +149,22 @@ class HighscoresData:
"""
return self._data[str(guild_id)]["tables"][table]["message_id"]
def reset_guild_data(self, guild_id: int) -> None:
"""
Resets highscore data for a guild. Should only be used for development really...
@param guild_id: guild id to reset data for
"""
guild_data: dict = self._data[str(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
self._data[str(guild_id)] = guild_data
save_highscores_data(self._data)
def set_table_message_id(self, guild_id: int, table: str, message_id: int) -> None:
"""
Sets the message id for given guild's table.