From af709306d716d2d1c19c288cec08a3fa74a20a5c Mon Sep 17 00:00:00 2001 From: Objectivitix <79152594+Objectivitix@users.noreply.github.com> Date: Sun, 9 May 2021 16:48:47 -0400 Subject: use walrus so dict lookup is only performed once Co-authored-by: ToxicKidz <78174417+ToxicKidz@users.noreply.github.com> --- bot/exts/evergreen/trivia_quiz.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bot') diff --git a/bot/exts/evergreen/trivia_quiz.py b/bot/exts/evergreen/trivia_quiz.py index d3def4f2..88c44971 100644 --- a/bot/exts/evergreen/trivia_quiz.py +++ b/bot/exts/evergreen/trivia_quiz.py @@ -336,8 +336,8 @@ class TriviaQuiz(commands.Cog): description=q, ) - if "img_url" in question_dict: - embed.set_image(url=question_dict["img_url"]) + if img_url := question_dict.get("image_url"): + embed.set_image(url=img_url) await ctx.send(embed=embed) # Send question embed. -- cgit v1.2.3