aboutsummaryrefslogtreecommitdiffstats
path: root/bot/exts/evergreen/reddit.py
diff options
context:
space:
mode:
authorGravatar ks129 <[email protected]>2021-04-30 12:14:00 +0300
committerGravatar GitHub <[email protected]>2021-04-30 12:14:00 +0300
commit109692e5b0efb181152ce5743d11fbea64171c9c (patch)
treeb20a8cc425d98d2f4b2ffc11ac1fe665b62b8192 /bot/exts/evergreen/reddit.py
parentAdd non-underscore aliases for lazy people like me :) (diff)
parentMerge pull request #709 from chincholikarsalil/fix-grammatical-error (diff)
Merge branch 'main' into Enforce-image-processing-concurrency
Diffstat (limited to 'bot/exts/evergreen/reddit.py')
-rw-r--r--bot/exts/evergreen/reddit.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/bot/exts/evergreen/reddit.py b/bot/exts/evergreen/reddit.py
index 49127bea..2be511c8 100644
--- a/bot/exts/evergreen/reddit.py
+++ b/bot/exts/evergreen/reddit.py
@@ -54,16 +54,16 @@ class Reddit(commands.Cog):
if not posts:
return await ctx.send('No posts available!')
- if posts[1]["data"]["over_18"] is True:
+ if posts[0]["data"]["over_18"] is True:
return await ctx.send(
- "You cannot access this Subreddit as it is ment for those who "
+ "You cannot access this Subreddit as it is meant for those who "
"are 18 years or older."
)
embed_titles = ""
# Chooses k unique random elements from a population sequence or set.
- random_posts = random.sample(posts, k=5)
+ random_posts = random.sample(posts, k=min(len(posts), 5))
# -----------------------------------------------------------
# This code below is bound of change when the emojis are added.