fix date comparison
This commit is contained in:
parent
257555242e
commit
16d9d5b9a3
@ -1,4 +1,5 @@
|
|||||||
import re
|
import re
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
import feedparser
|
import feedparser
|
||||||
from telebot import TeleBot
|
from telebot import TeleBot
|
||||||
@ -17,6 +18,8 @@ class NerfNowFeedModuleConfig(FeedModuleConfig):
|
|||||||
def execute(self, bot: TeleBot, chat_id, last_id):
|
def execute(self, bot: TeleBot, chat_id, last_id):
|
||||||
if last_id is None:
|
if last_id is None:
|
||||||
last_id = ''
|
last_id = ''
|
||||||
|
if isinstance(last_id, datetime):
|
||||||
|
last_id = last_id.isoformat()
|
||||||
|
|
||||||
feed = feedparser.parse('http://feeds.feedburner.com/nerfnow/full')
|
feed = feedparser.parse('http://feeds.feedburner.com/nerfnow/full')
|
||||||
for e in reversed(feed['entries']):
|
for e in reversed(feed['entries']):
|
||||||
|
Loading…
Reference in New Issue
Block a user