forked from GitHub/dbot
Merge github.com:reality/dbot into database
This commit is contained in:
commit
f924686871
@ -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) {
|
this.listener = function(event) {
|
||||||
if(event.action == 'NOTICE') {
|
if(event.action == 'NOTICE') {
|
||||||
var nickserv = dbot.config.servers[event.server].nickserv,
|
var nickserv = dbot.config.servers[event.server].nickserv,
|
||||||
@ -33,7 +60,7 @@ var nickserv = function(dbot) {
|
|||||||
if(event.user == nickserv) {
|
if(event.user == nickserv) {
|
||||||
var info = event.params.match(statusRegex);
|
var info = event.params.match(statusRegex);
|
||||||
if(info && _.has(this.authStack, event.server)) {
|
if(info && _.has(this.authStack, event.server)) {
|
||||||
if(info[2] == acceptableState ) {
|
if(info[2] == acceptableState) {
|
||||||
this.authStack[event.server][info[1]](true);
|
this.authStack[event.server][info[1]](true);
|
||||||
} else {
|
} else {
|
||||||
this.authStack[event.server][info[1]](false);
|
this.authStack[event.server][info[1]](false);
|
||||||
|
14
modules/nickserv/strings.json
Normal file
14
modules/nickserv/strings.json
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"authed": {
|
||||||
|
"en": "{nick} is authed with nickserv."
|
||||||
|
},
|
||||||
|
"not_authed": {
|
||||||
|
"en": "{nick} is not authed with nickserv."
|
||||||
|
},
|
||||||
|
"hostmask": {
|
||||||
|
"en": "Hostmask for {nick}: {host}"
|
||||||
|
},
|
||||||
|
"no_hostmask": {
|
||||||
|
"en": "No hostmask could be found for {nick}"
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user