diff options
author | 2021-05-13 13:34:06 -0400 | |
---|---|---|
committer | 2021-05-13 13:34:06 -0400 | |
commit | 2aa1916d5c8e4832f26f6da4094238e9a0021d1c (patch) | |
tree | 2ce3195a019ef84fd0b2d6509f5deec7b25e19bc /bot/exts/halloween/spookyrating.py | |
parent | fix: Resolve Merge Conflicts (diff) |
chore: Use pathlib.Path.read_text & write_text over open
Diffstat (limited to 'bot/exts/halloween/spookyrating.py')
-rw-r--r-- | bot/exts/halloween/spookyrating.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bot/exts/halloween/spookyrating.py b/bot/exts/halloween/spookyrating.py index 6c79fbed..105d2164 100644 --- a/bot/exts/halloween/spookyrating.py +++ b/bot/exts/halloween/spookyrating.py @@ -3,6 +3,7 @@ import json import logging import random from pathlib import Path +from typing import Dict import discord from discord.ext import commands @@ -12,9 +13,8 @@ from bot.constants import Colours log = logging.getLogger(__name__) -with Path("bot/resources/halloween/spooky_rating.json").open(encoding="utf8") as file: - data = json.load(file) - SPOOKY_DATA = sorted((int(key), value) for key, value in data.items()) +data: Dict[str, Dict[str, str]] = json.loads(Path("bot/resources/halloween/spooky_rating.json").read_text("utf8")) +SPOOKY_DATA = sorted((int(key), value) for key, value in data.items()) class SpookyRating(commands.Cog): |