mirror of
https://github.com/reality/dbot.git
synced 2024-12-18 00:22:35 +01:00
expose hostmask stuff in commands [Close #518]
This commit is contained in:
parent
9b8148f2e7
commit
c1cd9755e4
@ -24,6 +24,33 @@ var nickserv = function(dbot) {
|
||||
}
|
||||
};
|
||||
|
||||
this.commands = {
|
||||
'~auth': function(event) {
|
||||
var user = event.params[1] || event.user;
|
||||
this.api.auth(event.server, user, function(isAuthed) {
|
||||
if(isAuthed) {
|
||||
event.reply(dbot.t('authed', { 'nick': user }));
|
||||
} else {
|
||||
event.reply(dbot.t('not_authed', { 'nick': user }));
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
'~hostmask': function(event) {
|
||||
var user = event.params[1] || event.user;
|
||||
this.api.getUserHost(event.server, user, function(host) {
|
||||
if(host) {
|
||||
event.reply(dbot.t('hostmask', {
|
||||
'nick': user,
|
||||
'host': host
|
||||
}));
|
||||
} else {
|
||||
event.reply(dbot.t('no_hostmask', { 'nick': user }));
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
this.listener = function(event) {
|
||||
if(event.action == 'NOTICE') {
|
||||
var nickserv = dbot.config.servers[event.server].nickserv,
|
||||
|
Loading…
Reference in New Issue
Block a user