Browse Source

fixed no response error in reddit img module

master
Angerstoner 6 years ago
parent
commit
0009ffdf91
  1. 8
      reddit.py

8
reddit.py

@ -75,4 +75,10 @@ def reddit_img(bot, update, args):
update.message.reply_text("Geile, sag sub")
return
sub = args[0]
bot.send_photo(chat_id=update.message.chat_id, photo=get_reddit_post(sub, True))
post = get_reddit_post(sub, True)
try:
bot.send_photo(chat_id=update.message.chat_id, photo=post.url)
return
except AttributeError:
update.message.reply_text(post)
Loading…
Cancel
Save