2
0
mirror of https://github.com/Nick80835/microbot synced 2025-08-29 13:38:55 +00:00

remove vreddit support

This commit is contained in:
Nick80835 2020-05-04 20:07:43 -04:00
parent e146744685
commit d588cf1d06

View File

@ -62,15 +62,10 @@ async def imagefetcher(event, sub):
except AttributeError:
continue
if post.url:
if post.url.endswith(VALID_ENDS):
if post.url and post.url.endswith(VALID_ENDS):
image_url = post.url
title = post.title
break
elif "v.redd.it" in post.url:
image_url = post.media['reddit_video']['fallback_url'].split("?")[0]
title = post.title
break
if not image_url:
await event.reply(f"`Failed to find any valid content on `**r/{sub}**`!`")