From a59acafd48ff30c2de69fcab206025b4d7e3ffb3 Mon Sep 17 00:00:00 2001 From: moneromooo Date: Thu, 30 Jul 2015 21:43:51 +0100 Subject: [PATCH] reddit: allow tips after arbitrary text --- tipbot/modules/reddit.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tipbot/modules/reddit.py b/tipbot/modules/reddit.py index 3078e1e..38c75c1 100644 --- a/tipbot/modules/reddit.py +++ b/tipbot/modules/reddit.py @@ -151,8 +151,8 @@ class RedditNetwork(Network): else: # reddit special: +x as a reply means tip if not is_pm and hasattr(item,'parent_id'): - line=line.replace(self.keyword,'').strip() - if re.match("\+[0-9]*(\.[0-9]*)?",line): + if re.search("\+[0-9]*(\.[0-9]*)?[\t ]+"+self.keyword,line) or re.search(self.keyword+"[\t ]+\+[0-9]*(\.[0-9]*)?",line): + line=line.replace(self.keyword,'').strip() if self.on_command: try: parent_item=self.reddit.get_info(thing_id=item.parent_id)