From 451b7ea4d0bf65179f7e8ba0f49b60a3ab47ff71 Mon Sep 17 00:00:00 2001 From: Daniel Dowling Date: Thu, 31 Jan 2013 15:53:45 +0000 Subject: [PATCH] Cleaned up link slightly. --- modules/link/link.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/modules/link/link.js b/modules/link/link.js index 6c987f6..e9e1c7f 100644 --- a/modules/link/link.js +++ b/modules/link/link.js @@ -39,9 +39,7 @@ var link = function(dbot) { request("http://xkcd.com/info.0.json", function(error, response, body){ if (response.statusCode == "200") { data = JSON.parse(body); - comicId = data.num; - comicId = (Math.floor(Math.random() * comicId) + 1); - event.params[1] = comicId; + event.params[1] = (Math.floor(Math.random() * data.num) + 1); dbot.commands['~xkcd'](event); } });