From 16d9d5b9a3ee7f42e6de7df8421a2885bf20e082 Mon Sep 17 00:00:00 2001 From: bakatrouble Date: Mon, 2 Dec 2019 13:20:18 +0300 Subject: [PATCH] fix date comparison --- feeds/modules/nerfnow.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/feeds/modules/nerfnow.py b/feeds/modules/nerfnow.py index 5ab9ff4..bfa8f65 100644 --- a/feeds/modules/nerfnow.py +++ b/feeds/modules/nerfnow.py @@ -1,4 +1,5 @@ import re +from datetime import datetime import feedparser from telebot import TeleBot @@ -17,6 +18,8 @@ class NerfNowFeedModuleConfig(FeedModuleConfig): def execute(self, bot: TeleBot, chat_id, last_id): if last_id is None: last_id = '' + if isinstance(last_id, datetime): + last_id = last_id.isoformat() feed = feedparser.parse('http://feeds.feedburner.com/nerfnow/full') for e in reversed(feed['entries']):