only save newer tweets, don't override with older

This commit is contained in:
b3yond 2018-09-24 23:16:05 +02:00
parent 2d12aa7107
commit 2a4d517f1d

View file

@ -170,9 +170,10 @@ schlitz
return db.cur.fetchone()[0] return db.cur.fetchone()[0]
def save_seen_tweet(self, tweet_id): def save_seen_tweet(self, tweet_id):
db.execute("UPDATE seen_tweets SET tweet_id = ? WHERE user_id = ?;", if tweet_id > self.get_seen_tweet():
(tweet_id, self.uid)) db.execute("UPDATE seen_tweets SET tweet_id = ? WHERE user_id = ?;",
db.commit() (tweet_id, self.uid))
db.commit()
def get_seen_dm(self): def get_seen_dm(self):
db.execute("SELECT message_id FROM seen_dms WHERE user_id = ?;", db.execute("SELECT message_id FROM seen_dms WHERE user_id = ?;",