forked from GitHub/dbot
better request
This commit is contained in:
parent
80ff91b609
commit
aab0e8b6db
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"stream": "",
|
"stream": "http://tripsit.fm:8000",
|
||||||
"announce": [ { "server": "aberwiki", "name": "#dbot" } ],
|
"announce": [ { "server": "tripsit", "name": "#tripbot" } ],
|
||||||
"outputPrefix": "\u00033radio\u000f"
|
"outputPrefix": "\u00033radio\u000f"
|
||||||
}
|
}
|
||||||
|
@ -51,11 +51,18 @@ var radio = function(dbot) {
|
|||||||
'~request': function(event){
|
'~request': function(event){
|
||||||
var dj = this.data['icy-description'],
|
var dj = this.data['icy-description'],
|
||||||
song = event.input[1];
|
song = event.input[1];
|
||||||
dbot.say(event.server, dj, dbot.t('radio_request',{
|
|
||||||
'user': event.user,
|
dbot.api.users.resolveUser(event.server, dj, function(user) {
|
||||||
'song': song
|
if(user) {
|
||||||
}));
|
dbot.say(event.server, user.currentNick, dbot.t('radio_request',{
|
||||||
event.reply('Song requested!');
|
'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];
|
this.commands['~request'].regex = [/^request ([\d\w\s-]*)/, 2];
|
||||||
|
Loading…
Reference in New Issue
Block a user