better request

This commit is contained in:
reality 2014-07-19 16:57:45 +00:00
parent 80ff91b609
commit aab0e8b6db
2 changed files with 14 additions and 7 deletions

View File

@ -1,5 +1,5 @@
{
"stream": "",
"announce": [ { "server": "aberwiki", "name": "#dbot" } ],
"stream": "http://tripsit.fm:8000",
"announce": [ { "server": "tripsit", "name": "#tripbot" } ],
"outputPrefix": "\u00033radio\u000f"
}

View File

@ -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];