From febcd60844b5b410ee9599612a0acc2d1db3618d Mon Sep 17 00:00:00 2001 From: Sebastian Gehaxelt <github@gehaxelt.in> Date: Fri, 13 May 2016 10:11:10 +0200 Subject: [PATCH] Reverse feed order. Newest first. --- bot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bot.py b/bot.py index 23681f5..b101f76 100644 --- a/bot.py +++ b/bot.py @@ -50,7 +50,7 @@ class IRCBot(irc.client.SimpleIRCClient): # Print last 25 news. elif msg == "!last": answer = "" - for entry in self.__db.get_latest_news(): + for entry in self.__db.get_latest_news()[::-1]: answer += "#" + str(entry[0]) + ": " + entry[1] + ", " + entry[2] + ", " + entry[3] + "\n" # Print last 25 news for a specific feed @@ -60,7 +60,7 @@ class IRCBot(irc.client.SimpleIRCClient): feedid = int(msg.replace("!lastfeed","").strip()) except: return "Wrong command: " + msg + ", use: !lastfeed <feedid>" - for entry in self.__db.get_news_from_feed(feedid): + for entry in self.__db.get_news_from_feed(feedid)[::-1]: answer += "#" + str(entry[0]) + ": " + entry[1] + ", " + entry[2] + ", " + entry[3] + "\n" # Else tell the user how to use the bot -- GitLab