Skip to content

Commit

Permalink
Mark as sent if publish was successful
Browse files Browse the repository at this point in the history
  • Loading branch information
runo280 authored Jan 18, 2020
1 parent 8084991 commit ec4c9c0
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,12 @@
title = x['title']
link = x['link']
date = x['date']
telegram.send_article(title, link, date)
db.feeds.update_one({'link': link}, set_published_query)
send = telegram.send_article(title, link, date)
result = send.json()
if result['ok'] is True:
print('ok')
db.feeds.update_one({'link': link}, set_published_query)
else:
print('failed to publish')


0 comments on commit ec4c9c0

Please sign in to comment.