From ff4c1f9af96de56c16ee83a391bd2c00e5fee6bf Mon Sep 17 00:00:00 2001 From: Ari Koivula Date: Fri, 28 Jun 2013 03:13:21 +0300 Subject: [PATCH] [url] Make .title-command actually output the title. --- url.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/url.py b/url.py index f60ab595e8..1b9c7c56d5 100644 --- a/url.py +++ b/url.py @@ -95,8 +95,8 @@ def title_command(bot, trigger): urls = re.findall(url_finder, trigger) results = process_urls(bot, trigger, urls) - for result in results[:4]: - message = '[ %s ] - %s' % tuple(result) + for title, domain in results[:4]: + bot.reply('[ %s ] - %s' % (title, domain)) @rule('(?u).*(https?://\S+).*') @@ -113,8 +113,9 @@ def title_auto(bot, trigger): results = process_urls(bot, trigger, urls) bot.memory['last_seen_url'][trigger.sender] = urls[-1] - for result in results[:4]: - message = '[ %s ] - %s' % tuple(result) + for title, domain in results[:4]: + message = '[ %s ] - %s' % (title, domain) + # Guard against responding to other instances of this bot. if message != trigger: bot.say(message)