From 0009ffdf9112be096108ec7a6d6a9e46df7cb224 Mon Sep 17 00:00:00 2001 From: Angerstoner Date: Mon, 11 Mar 2019 03:27:07 +0100 Subject: [PATCH] fixed no response error in reddit img module --- reddit.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/reddit.py b/reddit.py index 8bd76b5..a4acff8 100644 --- a/reddit.py +++ b/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)