Skip to content

Commit

Permalink
Merge pull request #19 from cameronbwhite/master
Browse files Browse the repository at this point in the history
Fixed !next command
  • Loading branch information
Cameron White committed Feb 16, 2014
2 parents c5e8e3f + 83f7690 commit 97abb69
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion modules/acmbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,11 @@ def tomorrow_sort(events):
else:
def tomorrow_sort(events):
events = sorted(events, key=lambda x: x['date'], reverse=True)
return [ (0, events[0]) ]
events = list(enumerate(takewhile(
lambda x: x['date'] >= datetime.date.today(),
events,
)))
return [ events[-1] ]
messages = self.get_event_messages(tomorrow_sort)

elif self.args.command == "!help":
Expand Down

0 comments on commit 97abb69

Please sign in to comment.