From 541efecc44fffec87f7e9346619dcae0710e2a08 Mon Sep 17 00:00:00 2001 From: Rohan Date: Thu, 15 Apr 2021 20:42:14 +0530 Subject: Apply code review suggestions. --- bot/exts/evergreen/reddit.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bot') diff --git a/bot/exts/evergreen/reddit.py b/bot/exts/evergreen/reddit.py index 7f4ce6a0..916563ac 100644 --- a/bot/exts/evergreen/reddit.py +++ b/bot/exts/evergreen/reddit.py @@ -86,11 +86,11 @@ class Reddit(Cog): author = data["author"] content_type = Emojis.reddit_post_text - if data["is_video"] is True or {"youtube", "youtu.be"}.issubset(set(data["url"].split("."))): + if data["is_video"] or {"youtube", "youtu.be"}.issubset(set(data["url"].split("."))): # This means the content type in the post is a video. content_type = f"{Emojis.reddit_post_video}" - elif any(data["url"].endswith(pic_format) for pic_format in ("jpg", "png", "gif")): + elif data["url"].endswith(("jpg", "png", "gif")): # This means the content type in the post is an image. content_type = f"{Emojis.reddit_post_photo}" image_url = data["url"] -- cgit v1.2.3