From be776405e36e230a18821e293e0087b7bd540938 Mon Sep 17 00:00:00 2001 From: nemunaire Date: Mon, 21 Sep 2015 02:23:15 +0200 Subject: [PATCH] Dusting URL stacking modules: fixing error when using channel list as response --- modules/reddit.py | 7 ++++--- modules/youtube-title.py | 7 ++++--- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/modules/reddit.py b/modules/reddit.py index 63bb6eb..53791ff 100644 --- a/modules/reddit.py +++ b/modules/reddit.py @@ -82,9 +82,10 @@ def parseresponse(msg): try: urls = re.findall("www.reddit.com(/\w/\w+/?)", msg.text) for url in urls: - if msg.channel not in LAST_SUBS: - LAST_SUBS[msg.channel] = list() - LAST_SUBS[msg.channel].append(url) + for recv in msg.receivers: + if recv not in LAST_SUBS: + LAST_SUBS[recv] = list() + LAST_SUBS[recv].append(url) except: pass diff --git a/modules/youtube-title.py b/modules/youtube-title.py index 4842d1d..c7bbd9f 100644 --- a/modules/youtube-title.py +++ b/modules/youtube-title.py @@ -89,7 +89,8 @@ def parseresponse(msg): if o.scheme != "": if o.netloc == "" and len(o.path) < 10: continue - if msg.channel not in LAST_URLS: - LAST_URLS[msg.channel] = list() - LAST_URLS[msg.channel].append(url) + for recv in msg.receivers: + if recv not in LAST_URLS: + LAST_URLS[recv] = list() + LAST_URLS[recv].append(url) return msg