aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/halloween/monstersurvey.py
diff options
context:
space:
mode:
Diffstat (limited to 'bot/exts/halloween/monstersurvey.py')
-rw-r--r--bot/exts/halloween/monstersurvey.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/bot/exts/halloween/monstersurvey.py b/bot/exts/halloween/monstersurvey.py
index 231454ea..240a97db 100644
--- a/bot/exts/halloween/monstersurvey.py
+++ b/bot/exts/halloween/monstersurvey.py
@@ -26,14 +26,12 @@ class MonsterSurvey(Cog):
def __init__(self):
"""Initializes values for the bot to use within the voting commands."""
self.registry_path = pathlib.Path("bot", "resources", "halloween", "monstersurvey.json")
- with self.registry_path.open(encoding="utf8") as data:
- self.voter_registry = json.load(data)
+ self.voter_registry = json.loads(self.registry_path.read_text("utf8"))
def json_write(self) -> None:
"""Write voting results to a local JSON file."""
log.info("Saved Monster Survey Results")
- with self.registry_path.open("w", encoding="utf8") as data:
- json.dump(self.voter_registry, data, indent=2)
+ self.registry_path.write_text(json.dumps(self.voter_registry, indent=2))
def cast_vote(self, id: int, monster: str) -> None:
"""