Skip to content

Commit

Permalink
minor fix
Browse files Browse the repository at this point in the history
  • Loading branch information
fabiosangregorio committed Mar 23, 2019
1 parent 8ef5f4a commit 1b62477
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion reddit_linker.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def send_post(bot, chat_id, subreddit=None, post_url=None):

post_is_gif, gif_url = is_gif(post_url)
except Exception as e:
print(e)
send_exception_message(bot, chat_id, f"I'm sorry, an error occurred in retrieving\nthe post from {subreddit} :(\n"\
"The developer must have missed an if statement!")

Expand All @@ -77,6 +78,7 @@ def send_post(bot, chat_id, subreddit=None, post_url=None):
intent="random_post")
msg.send()
except Exception as e:
print(e)
send_exception_message(bot, chat_id, f"I'm sorry, an error occurred in sending\nthe post from {subreddit} :(\n"\
"The developer must have missed an if statement!")

Expand All @@ -85,7 +87,6 @@ def send_exception_message(bot, chat_id, msg):
keyboard = InlineKeyboardMarkup(inline_keyboard=[
[InlineKeyboardButton(text='Try again', callback_data='reddit')]
])
print(e)
bot.sendMessage(chat_id, msg, reply_markup=keyboard, parse_mode='Markdown')
msg = Message(api_key=TOKEN,
platform="Telegram",
Expand Down

2 comments on commit 1b62477

@fabiosangregorio
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@fabiosangregorio
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.