aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/evergreen/trivia_quiz.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/evergreen/trivia_quiz.py
parentfix: Resolve Merge Conflicts (diff)
chore: Use pathlib.Path.read_text & write_text over open
Diffstat (limited to 'bot/exts/evergreen/trivia_quiz.py')
-rw-r--r--bot/exts/evergreen/trivia_quiz.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/bot/exts/evergreen/trivia_quiz.py b/bot/exts/evergreen/trivia_quiz.py
index 1953253b..9db201ef 100644
--- a/bot/exts/evergreen/trivia_quiz.py
+++ b/bot/exts/evergreen/trivia_quiz.py
@@ -41,9 +41,7 @@ class TriviaQuiz(commands.Cog):
def load_questions() -> dict:
"""Load the questions from the JSON file."""
p = Path("bot", "resources", "evergreen", "trivia_quiz.json")
- with p.open(encoding="utf8") as json_data:
- questions = json.load(json_data)
- return questions
+ return json.loads(p.read_text("utf8"))
@commands.group(name="quiz", aliases=["trivia"], invoke_without_command=True)
async def quiz_game(self, ctx: commands.Context, category: str = None) -> None: