I am buiding a discord bot with dicord.py and praw and I want to exclude all video and gallery posts since they don't embed properly in discord. I tried using a in statement and telling it to search for a new post again but it still does not work. (this is my first python project so be nice)
heres what i tried:
elif user_message.lower() == '!dog':
sub = reddit.subreddit('rarepuppers')
posts = [post for post in sub.hot(limit=250)]
random_post_number = random.randint(0, 250)
random_post = posts[random_post_number]
strForm = "{}".format(random_post.url)
if 'v.redd.it' or 'gallery' in random_post.url:
random_post_number = random.randint(0, 250)
random_post = posts[random_post_number]
strForm = "{}".format(random_post.url)
await message.channel.send(random_post.url)
return
await message.channel.send(random_post.url)
return