From df096e7cc4f38bfe233f79e8a746b8862b4035b6 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Wed, 13 Jul 2022 15:06:59 +0200 Subject: [PATCH] add #roll --- files/helpers/regex.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/files/helpers/regex.py b/files/helpers/regex.py index 2c70b9ef2..a7a0f28d7 100644 --- a/files/helpers/regex.py +++ b/files/helpers/regex.py @@ -137,10 +137,11 @@ def torture_ap(body, username): commands = { "fortune": FORTUNE_REPLIES, "factcheck": FACTCHECK_REPLIES, - "8ball": EIGHTBALL_REPLIES + "8ball": EIGHTBALL_REPLIES, + "roll": range(1, 9999) } -command_regex = re.compile("(\s|\n|^)#(fortune|factcheck|8ball)", flags=re.A|re.I) +command_regex = re.compile("(\s|\n|^)#(fortune|factcheck|8ball|roll)", flags=re.A|re.I) def command_regex_matcher(match, upper=False): - return match.group(1) + choice(commands[match.group(2).lower()]) \ No newline at end of file + return match.group(1) + str(choice(commands[match.group(2).lower()])) \ No newline at end of file