diff --git a/robopage.py b/robopage.py index 81d1305..91e6cee 100644 --- a/robopage.py +++ b/robopage.py @@ -25,9 +25,14 @@ class RoboPage(discord.Client): attrs = filter(lambda n: n.endswith('Joke') and not n.startswith('Joke'), dir(jokes)) attrs = map(lambda n: getattr(jokes, n)(), attrs) self.jokes = list(attrs) - self.most_regex = re.compile("^who is the most (?P\w+)(?: in the past (?P\d+) days)?\??$", - re.IGNORECASE) - self.leaderboard_regex = re.compile('^most (?P\w+) leaderboard$', re.IGNORECASE) + self.most_regex = re.compile( + "^who is the most (?P\w+)(?: in the past (?P\d+) days)?\??$", + re.IGNORECASE + ) + self.leaderboard_regex = re.compile( + '^most (?P\w+)(?=(?:.+)?leaderboard)(?:.+(?P\d+) days)?', + re.IGNORECASE + ) with Path('gifs.json').open('r') as file: self.gifs = json.load(file)