diff --git a/commands.py b/commands.py index c824ff4..0554a58 100644 --- a/commands.py +++ b/commands.py @@ -1,3 +1,4 @@ +import datetime import random import dateutil.parser @@ -50,10 +51,13 @@ class Commands(object): try: messages = self._get_messages(dict( commenter='bellateeny', - term='quote')) + term='quote')).json() except requests.exceptions.HTTPError as e: raise CommandError(e) else: + # quotes before this date can have wrong IDs + threshold = datetime.datetime(2018, 5, 11) + messages = [m for m in messages if dateutil.parser.parse(m['created_at']) >= threshold] return [m.get('message_body', '') for m in messages] def last_quote(self):