forked from GitHub/dbot
isPrimaryUser and getAliases in users module
This commit is contained in:
parent
60fb7970ef
commit
a14fddc49d
@ -70,6 +70,20 @@ var users = function(dbot) {
|
||||
'isKnownUser': function(server, nick) {
|
||||
var knownUsers = getServerUsers(server);
|
||||
return (_.include(knownUsers.users, nick) || _.has(knownUsers.aliases, nick));
|
||||
},
|
||||
|
||||
'isPrimaryUser': function(server, nick) {
|
||||
return _.include(knownUsers.users, nick);
|
||||
}
|
||||
|
||||
'getAliases': function(server, nick) {
|
||||
var knownUsers = getServerUsers(server);
|
||||
return _.chain(knownUsers.aliases)
|
||||
.keys()
|
||||
.filter(function(user) {
|
||||
return knownUsers.aliases[user] == nick;
|
||||
}, this)
|
||||
.value();
|
||||
}
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user