From 35e34874af3ac808356dfc04ee99270404cbd662 Mon Sep 17 00:00:00 2001 From: reality Date: Sun, 13 Jan 2013 15:30:53 +0000 Subject: [PATCH] link underscorised (easy) [#81] --- modules/link/link.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/link/link.js b/modules/link/link.js index 7b6d3b2..0c275eb 100644 --- a/modules/link/link.js +++ b/modules/link/link.js @@ -3,7 +3,9 @@ * Description: Stores recent channel links, with commands to retrieve * information about links. */ -var request = require('request'); +var request = require('request'), + _ = require('underscore')._; + var link = function(dbot) { var urlRegex = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/ig; var links = {}; @@ -22,7 +24,7 @@ var link = function(dbot) { var commands = { '~title': function(event) { var link = links[event.channel.name]; - if(event.params[1] !== undefined) { + if(_.isUndefined(event.params[1])) { var urlMatches = event.params[1].match(urlRegex); if(urlMatches !== null) { link = urlMatches[0];