🏡 index : ~doyle/dave.git

author Jordan Doyle <jordan@doyle.wf> 2017-07-31 15:49:58.0 +00:00:00
committer GitHub <noreply@github.com> 2017-07-31 15:49:58.0 +00:00:00
commit
6a4cf06518b72dfe5438e31b9db89df7b7d0866d [patch]
tree
006f6d5b4dd45d1a223f05117feaa19c1b5d3272
parent
ee2bced55fef1182b93c038f70a9749bec452a1d
download
6a4cf06518b72dfe5438e31b9db89df7b7d0866d.tar.gz

Don't match r/something in the middle of a sentence



Diff

 dave/modules/reddit.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dave/modules/reddit.py b/dave/modules/reddit.py
index 629b897..e3520bc 100644
--- a/dave/modules/reddit.py
+++ b/dave/modules/reddit.py
@@ -7,8 +7,8 @@ from twisted.words.protocols.irc import assembleFormattedText, attributes as A
from requests import get
from humanize import naturaltime, naturaldelta, intcomma

@dave.module.match(r'.*(?:https?://(?:www\.)?reddit.com)?(/r/(.+)/comments/([^\s]+)).*')
@dave.module.match(r'.*https?://(?:www\.)?redd.it/([^\s]+).*')
@dave.module.match(r'.*(?:^| )(?:https?://(?:www\.)?reddit.com)?(/r/(.+)/comments/([^\s]+))(?: |$).*')
@dave.module.match(r'.*(?:^| )https?://(?:www\.)?redd.it/([^\s]+)(?: |$).*')
@dave.module.ratelimit(1, 1)
@dave.module.dont_always_run_if_run()
def post(bot, args, sender, source):
@@ -44,7 +44,7 @@ def post(bot, args, sender, source):
        ]
    ))

@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 @@ def subreddit(bot, args, sender, source):
    ))


@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):