From 7eec11197a6ea023146e7496226d362552def896 Mon Sep 17 00:00:00 2001 From: reality Date: Sat, 24 Aug 2013 13:28:46 +0000 Subject: [PATCH 1/3] thingy thingy --- modules/imgur/imgur.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/imgur/imgur.js b/modules/imgur/imgur.js index 9e0eaef..9458e41 100644 --- a/modules/imgur/imgur.js +++ b/modules/imgur/imgur.js @@ -153,10 +153,14 @@ var imgur = function(dbot) { this.commands = { '~ri': function(event) { + var local = event.user; + if(event.params[1]) { + local = event.params.splice(0, 1).join(' '); + } this.api.getRandomImage(function(link, slug) { this.api.getImageInfo(slug, function(imgData) { var info = this.internalAPI.infoString(imgData); - event.reply(event.user + ': ' + link + ' [' + info + ']'); + event.reply(local + ': ' + link + ' [' + info + ']'); }.bind(this)); }.bind(this)); } From 4f4cdea95142c5d7ac75be522dc4229d348f3b09 Mon Sep 17 00:00:00 2001 From: reality Date: Sat, 24 Aug 2013 13:30:17 +0000 Subject: [PATCH 2/3] this thing --- modules/imgur/imgur.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/imgur/imgur.js b/modules/imgur/imgur.js index 9458e41..066db91 100644 --- a/modules/imgur/imgur.js +++ b/modules/imgur/imgur.js @@ -155,7 +155,7 @@ var imgur = function(dbot) { '~ri': function(event) { var local = event.user; if(event.params[1]) { - local = event.params.splice(0, 1).join(' '); + local = event.params.splice(1, event.params.length - 1).join(' '); } this.api.getRandomImage(function(link, slug) { this.api.getImageInfo(slug, function(imgData) { From a40abd4bbdc95f9ed37558c7f289d848994d27f6 Mon Sep 17 00:00:00 2001 From: reality Date: Sat, 24 Aug 2013 13:31:12 +0000 Subject: [PATCH 3/3] and trim it --- modules/imgur/imgur.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/imgur/imgur.js b/modules/imgur/imgur.js index 066db91..e796277 100644 --- a/modules/imgur/imgur.js +++ b/modules/imgur/imgur.js @@ -155,7 +155,7 @@ var imgur = function(dbot) { '~ri': function(event) { var local = event.user; if(event.params[1]) { - local = event.params.splice(1, event.params.length - 1).join(' '); + local = event.params.splice(1, event.params.length - 1).join(' ').trim(); } this.api.getRandomImage(function(link, slug) { this.api.getImageInfo(slug, function(imgData) {