From aab0e8b6db44403a412fe109f17b9ae26c5fbe5f Mon Sep 17 00:00:00 2001 From: reality Date: Sat, 19 Jul 2014 16:57:45 +0000 Subject: [PATCH] better request --- modules/radio/config.json | 4 ++-- modules/radio/radio.js | 17 ++++++++++++----- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/modules/radio/config.json b/modules/radio/config.json index 3cb4868..2eeff65 100644 --- a/modules/radio/config.json +++ b/modules/radio/config.json @@ -1,5 +1,5 @@ { - "stream": "", - "announce": [ { "server": "aberwiki", "name": "#dbot" } ], + "stream": "http://tripsit.fm:8000", + "announce": [ { "server": "tripsit", "name": "#tripbot" } ], "outputPrefix": "\u00033radio\u000f" } diff --git a/modules/radio/radio.js b/modules/radio/radio.js index e628815..b302be0 100644 --- a/modules/radio/radio.js +++ b/modules/radio/radio.js @@ -51,11 +51,18 @@ var radio = function(dbot) { '~request': function(event){ var dj = this.data['icy-description'], song = event.input[1]; - dbot.say(event.server, dj, dbot.t('radio_request',{ - 'user': event.user, - 'song': song - })); - event.reply('Song requested!'); + + dbot.api.users.resolveUser(event.server, dj, function(user) { + if(user) { + dbot.say(event.server, user.currentNick, dbot.t('radio_request',{ + 'user': event.user, + 'song': song + })); + event.reply('Song request sent to DJ ' + user.currentNick + '!'); + } else { + event.reply('Couldn\'t find DJ ' + dj + ' on IRC :('); + } + }); } }; this.commands['~request'].regex = [/^request ([\d\w\s-]*)/, 2];