diff --git a/modules/users/README.md b/modules/users/README.md index 34195c4..0a11e5b 100644 --- a/modules/users/README.md +++ b/modules/users/README.md @@ -51,3 +51,6 @@ Return whether a user is online in a given channel on the given server. #### nick_changed(server, newNick) This is executed when a new alias is added for a user. + +#### new_user(server, nick) +This is executed when a new primary user is added to the known users DB. diff --git a/modules/users/users.js b/modules/users/users.js index 8e934b7..205eb76 100644 --- a/modules/users/users.js +++ b/modules/users/users.js @@ -48,6 +48,7 @@ var users = function(dbot) { nick = this.api.resolveUser(event.server, nick); } else { knownUsers.users.push(nick); + dbot.api.emit('new_user', [ event.server, nick ]); } if(!_.include(channelUsers, nick)) { @@ -78,6 +79,7 @@ var users = function(dbot) { nick = this.api.resolveUser(event.server, nick); } else { knownUsers.users.push(nick); + dbot.api.emit('new_user', [ event.server, nick ]); } if(!_.include(channelUsers, nick)) { channelUsers.push(nick);