improved the leaderboard regex
This commit is contained in:
11
robopage.py
11
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<emoji>\w+)(?: in the past (?P<days>\d+) days)?\??$",
|
||||
re.IGNORECASE)
|
||||
self.leaderboard_regex = re.compile('^most (?P<emoji>\w+) leaderboard$', re.IGNORECASE)
|
||||
self.most_regex = re.compile(
|
||||
"^who is the most (?P<emoji>\w+)(?: in the past (?P<days>\d+) days)?\??$",
|
||||
re.IGNORECASE
|
||||
)
|
||||
self.leaderboard_regex = re.compile(
|
||||
'^most (?P<emoji>\w+)(?=(?:.+)?leaderboard)(?:.+(?P<days>\d+) days)?',
|
||||
re.IGNORECASE
|
||||
)
|
||||
|
||||
with Path('gifs.json').open('r') as file:
|
||||
self.gifs = json.load(file)
|
||||
|
||||
Reference in New Issue
Block a user