|
|
@ -1,3 +1,4 @@
|
|
|
|
|
|
|
|
import datetime
|
|
|
|
import random
|
|
|
|
import random
|
|
|
|
|
|
|
|
|
|
|
|
import dateutil.parser
|
|
|
|
import dateutil.parser
|
|
|
@ -50,10 +51,13 @@ class Commands(object):
|
|
|
|
try:
|
|
|
|
try:
|
|
|
|
messages = self._get_messages(dict(
|
|
|
|
messages = self._get_messages(dict(
|
|
|
|
commenter='bellateeny',
|
|
|
|
commenter='bellateeny',
|
|
|
|
term='quote'))
|
|
|
|
term='quote')).json()
|
|
|
|
except requests.exceptions.HTTPError as e:
|
|
|
|
except requests.exceptions.HTTPError as e:
|
|
|
|
raise CommandError(e)
|
|
|
|
raise CommandError(e)
|
|
|
|
else:
|
|
|
|
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]
|
|
|
|
return [m.get('message_body', '') for m in messages]
|
|
|
|
|
|
|
|
|
|
|
|
def last_quote(self):
|
|
|
|
def last_quote(self):
|
|
|
|