mirror of
https://github.com/Nick80835/microbot
synced 2025-08-30 05:58:23 +00:00
make redt error less on empty subs
This commit is contained in:
parent
f8b28157be
commit
eb71d6b688
@ -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)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user