diff --git a/modules/users/README.md b/modules/users/README.md index ee157de..032d7cd 100644 --- a/modules/users/README.md +++ b/modules/users/README.md @@ -50,6 +50,11 @@ channel was found from the given parameters. Get a list of all users the bot currently knows about. Callback is called with one argument, a list of user records. +#### isOnline +Is the given nick on the given server currently in the given channel. Callback +is called with one argument, a boolean as to whether the nick is currently in +the specified place. + ### Data #### User Object diff --git a/modules/users/api.js b/modules/users/api.js index 830dd39..53f3727 100644 --- a/modules/users/api.js +++ b/modules/users/api.js @@ -79,42 +79,6 @@ var api = function(dbot) { }); }, - 'isKnownUser': function(server, nick, callback) { - this.api.resolveUser(server, nick, function(isKnown) { - if(isKnown == false) { - callback(false); - } else { - callback(true); - } - }); - }, - - 'isPrimaryUser': function(server, nick, callback) { - var isPrimaryUser = false; - this.db.search('users', { - 'server': server, - 'primaryNick': nick - }, function(user) { - isPrimaryUser = true; - }, function(err) { - if(!err) { - callback(isPrimaryUser); - } - }); - }, - - 'getAliases': function(server, nick, callback) { - var aliases; - this.db.search('users', { - 'server': server, - 'primaryNick': nick - }, function(result) { - aliases = result.aliases; - }, function(err) { - callback(aliases); - }); - }, - 'isOnline': function(server, nick, channel, callback) { this.api.resolveUser(server, nick, function(user) { var possiNicks = [user].concat(user.aliases); @@ -129,13 +93,6 @@ var api = function(dbot) { callback(isOnline); } }); - }, - - 'isChannelUser': function(server, nick, channel, callback) { - this.api.resolveUser(server, nick, function(user) { - var isChannelUser = _.include(user.channels, channel); - callback(isChannelUser); - }); } };