Skip to content
Snippets Groups Projects
Commit febcd608 authored by Sebastian Gehaxelt's avatar Sebastian Gehaxelt
Browse files

Reverse feed order. Newest first.

parent eabf26ff
No related branches found
No related tags found
No related merge requests found
...@@ -50,7 +50,7 @@ class IRCBot(irc.client.SimpleIRCClient): ...@@ -50,7 +50,7 @@ class IRCBot(irc.client.SimpleIRCClient):
# Print last 25 news. # Print last 25 news.
elif msg == "!last": elif msg == "!last":
answer = "" 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" answer += "#" + str(entry[0]) + ": " + entry[1] + ", " + entry[2] + ", " + entry[3] + "\n"
# Print last 25 news for a specific feed # Print last 25 news for a specific feed
...@@ -60,7 +60,7 @@ class IRCBot(irc.client.SimpleIRCClient): ...@@ -60,7 +60,7 @@ class IRCBot(irc.client.SimpleIRCClient):
feedid = int(msg.replace("!lastfeed","").strip()) feedid = int(msg.replace("!lastfeed","").strip())
except: except:
return "Wrong command: " + msg + ", use: !lastfeed <feedid>" 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" answer += "#" + str(entry[0]) + ": " + entry[1] + ", " + entry[2] + ", " + entry[3] + "\n"
# Else tell the user how to use the bot # Else tell the user how to use the bot
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment