aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bot/exts/info/reddit.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/bot/exts/info/reddit.py b/bot/exts/info/reddit.py
index 606c26aa7..f2aecc498 100644
--- a/bot/exts/info/reddit.py
+++ b/bot/exts/info/reddit.py
@@ -140,7 +140,12 @@ class Reddit(Cog):
# Got appropriate response - process and return.
content = await response.json()
posts = content["data"]["children"]
- if posts[0]["data"]["over_18"]:
+
+ for post in posts:
+ if post["data"]["over_18"]:
+ posts.remove(post)
+
+ if not posts:
resp_not_allowed = [
{
"error": "Oops ! Looks like this subreddit, doesn't fit in the scope of the server."