save last_id more often
This commit is contained in:
@@ -17,5 +17,4 @@ class WPComicFeedModuleConfig(FeedModuleConfig):
|
||||
media = requests.get('{}/wp-json/wp/v2/media'.format(self.domain.rstrip('/'))).json()
|
||||
for m in filter(lambda x: x['id'] > last_id, reversed(media)):
|
||||
bot.send_photo(chat_id, photo=m['source_url'], caption=m['title']['rendered'])
|
||||
last_id = m['id']
|
||||
return last_id
|
||||
yield m['id']
|
||||
|
Reference in New Issue
Block a user