From a50c6ab6d902f43c4091b7b1b75a8f9df3bbc0bb Mon Sep 17 00:00:00 2001 From: Nick80835 <24271245+Nick80835@users.noreply.github.com> Date: Mon, 6 Jan 2025 09:16:46 -0500 Subject: [PATCH] remove usage of subreddit.random --- ubot/modules/reddit.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ubot/modules/reddit.py b/ubot/modules/reddit.py index 1885766..88e47d8 100644 --- a/ubot/modules/reddit.py +++ b/ubot/modules/reddit.py @@ -38,7 +38,7 @@ async def imagefetcher(event, sub): for _ in range(10): try: - post = await subreddit.random() or await imagefetcherfallback(subreddit) + post = await imagefetcherfallback(subreddit) post.title if event.nsfw_disabled and post.over_18: @@ -71,7 +71,7 @@ async def titlefetcher(event, sub): subreddit = await REDDIT.subreddit(sub) try: - post = await subreddit.random() or await titlefetcherfallback(subreddit) + post = await titlefetcherfallback(subreddit) post.title except redex.Forbidden: await event.reply(f"**r/{sub}** is private!") @@ -91,7 +91,7 @@ async def bodyfetcher(event, sub): for _ in range(10): try: - post = await subreddit.random() or await bodyfetcherfallback(subreddit) + post = await bodyfetcherfallback(subreddit) post.title except redex.Forbidden: await event.reply(f"**r/{sub}** is private!")