mirror of
https://github.com/reality/dbot.git
synced 2024-11-23 20:39:25 +01:00
better request
This commit is contained in:
parent
80ff91b609
commit
aab0e8b6db
@ -1,5 +1,5 @@
|
||||
{
|
||||
"stream": "",
|
||||
"announce": [ { "server": "aberwiki", "name": "#dbot" } ],
|
||||
"stream": "http://tripsit.fm:8000",
|
||||
"announce": [ { "server": "tripsit", "name": "#tripbot" } ],
|
||||
"outputPrefix": "\u00033radio\u000f"
|
||||
}
|
||||
|
@ -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',{
|
||||
|
||||
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 requested!');
|
||||
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];
|
||||
|
Loading…
Reference in New Issue
Block a user