From 4b7c2092b0ffc52fc005c2d3d065ebe42b30ba2b Mon Sep 17 00:00:00 2001 From: Daniel Dowling Date: Thu, 31 Jan 2013 17:20:51 +0000 Subject: [PATCH] Added check for params[1] to ~xkcd --- modules/link/link.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/link/link.js b/modules/link/link.js index e9e1c7f..2cdce4c 100644 --- a/modules/link/link.js +++ b/modules/link/link.js @@ -34,7 +34,10 @@ var link = function(dbot) { }, '~xkcd': function(event) { - var comicId = event.params[1]; + var comicId; + if(!_.isUndefined(event.params[1])) { + comicId = event.params[1]; + } if(comicId == "*"){ request("http://xkcd.com/info.0.json", function(error, response, body){ if (response.statusCode == "200") { @@ -59,6 +62,7 @@ var link = function(dbot) { } }); } + }, '~ud': function(event) {