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/evergreen/magic_8ball.py | |
parent | fix: Resolve Merge Conflicts (diff) |
chore: Use pathlib.Path.read_text & write_text over open
Diffstat (limited to 'bot/exts/evergreen/magic_8ball.py')
-rw-r--r-- | bot/exts/evergreen/magic_8ball.py | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/bot/exts/evergreen/magic_8ball.py b/bot/exts/evergreen/magic_8ball.py index 7c9b929d..4b3ed2a4 100644 --- a/bot/exts/evergreen/magic_8ball.py +++ b/bot/exts/evergreen/magic_8ball.py @@ -14,8 +14,7 @@ class Magic8ball(commands.Cog): """A Magic 8ball command to respond to a user's question.""" def __init__(self): - with open(Path("bot/resources/evergreen/magic8ball.json"), "r", encoding="utf8") as file: - self.answers = json.load(file) + self.answers = json.loads(Path("bot/resources/evergreen/magic8ball.json").read_text("utf8")) @commands.command(name="8ball") async def output_answer(self, ctx: commands.Context, *, question: str) -> None: |