aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/valentines/lovecalculator.py
diff options
context:
space:
mode:
authorGravatar ToxicKidz <[email protected]>2021-05-13 13:34:06 -0400
committerGravatar ToxicKidz <[email protected]>2021-05-13 13:34:06 -0400
commit2aa1916d5c8e4832f26f6da4094238e9a0021d1c (patch)
tree2ce3195a019ef84fd0b2d6509f5deec7b25e19bc /bot/exts/valentines/lovecalculator.py
parentfix: Resolve Merge Conflicts (diff)
chore: Use pathlib.Path.read_text & write_text over open
Diffstat (limited to 'bot/exts/valentines/lovecalculator.py')
-rw-r--r--bot/exts/valentines/lovecalculator.py5
1 files changed, 2 insertions, 3 deletions
diff --git a/bot/exts/valentines/lovecalculator.py b/bot/exts/valentines/lovecalculator.py
index 8a4c71eb..b10b7bca 100644
--- a/bot/exts/valentines/lovecalculator.py
+++ b/bot/exts/valentines/lovecalculator.py
@@ -15,9 +15,8 @@ from bot.bot import Bot
log = logging.getLogger(__name__)
-with Path("bot/resources/valentines/love_matches.json").open(encoding="utf8") as file:
- LOVE_DATA = json.load(file)
- LOVE_DATA = sorted((int(key), value) for key, value in LOVE_DATA.items())
+LOVE_DATA = json.loads(Path("bot/resources/valentines/love_matches.json").read_text("utf8"))
+LOVE_DATA = sorted((int(key), value) for key, value in LOVE_DATA.items())
class LoveCalculator(Cog):