From e16101c83891d6fa09ea13edcb03f5ba97294776 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?N=C3=A9munaire?= Date: Sun, 14 Oct 2012 23:52:30 +0200 Subject: [PATCH] YCC module: First URL on a channel can now be reduce --- modules/ycc/__init__.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/modules/ycc/__init__.py b/modules/ycc/__init__.py index 360d0da..6b412ff 100644 --- a/modules/ycc/__init__.py +++ b/modules/ycc/__init__.py @@ -48,9 +48,8 @@ def parselisten(msg): global LAST_URLS if re.match(".*(https?://|www\.)[^ ]+.*", msg.content) is not None: res = re.match(".*(((ht|f)tps?://|www\.)[^ ]+).*", msg.content) - if msg.channel in LAST_URLS: - LAST_URLS[msg.channel].append(res.group(1)) - else: - LAST_URLS[msg.channel] = list(res.group(1)) + if msg.channel not in LAST_URLS: + LAST_URLS[msg.channel] = list() + LAST_URLS[msg.channel].append(res.group(1)) return True return False