From 3cf92ed056fbfd076d025a61dd4ef539baa5b643 Mon Sep 17 00:00:00 2001 From: Jordan Doyle Date: Mon, 31 Jul 2017 19:42:43 +0100 Subject: [PATCH] Only match /r/ and /u/, not r/ and u/ --- dave/modules/reddit.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dave/modules/reddit.py b/dave/modules/reddit.py index e3520bc..65fc2e0 100644 --- a/dave/modules/reddit.py +++ a/dave/modules/reddit.py @@ -44,7 +44,7 @@ ] )) -@dave.module.match(r'.*(?:^| )(?:https?://(?:www\.)?reddit.com)?/?r/(([^\s/]+))/?(?: |$).*') +@dave.module.match(r'.*(?:^| )(?:https?://(?:www\.)?reddit.com)?/r/(([^\s/]+))/?(?: |$).*') @dave.module.ratelimit(1, 1) @dave.module.dont_always_run_if_run() def subreddit(bot, args, sender, source): @@ -84,7 +84,7 @@ )) -@dave.module.match(r'.*(?:^| )(?:https?://(?:www\.)?reddit.com)?/?(?:u|user)/(([^\s]+)/?)(?: |$).*') +@dave.module.match(r'.*(?:^| )(?:https?://(?:www\.)?reddit.com)?/(?:u|user)/(([^\s]+)/?)(?: |$).*') @dave.module.ratelimit(1, 1) @dave.module.dont_always_run_if_run() def user(bot, args, sender, source): -- rgit 0.1.3