diff --git a/ubot/modules/reddit.py b/ubot/modules/reddit.py index 91126d8..e99ca2b 100644 --- a/ubot/modules/reddit.py +++ b/ubot/modules/reddit.py @@ -67,12 +67,16 @@ async def titlefetcher(event, sub): try: post = await subreddit.random() or await titlefetcherfallback(subreddit) + post.title except redex.Forbidden: await event.reply(f"**r/{sub}** is private!") return except (redex.NotFound, KeyError): await event.reply(f"**r/{sub}** doesn't exist!") return + except AttributeError: + await event.reply(f"Failed to find any valid content on **r/{sub}**!") + return await event.reply(post.title)