3
0
mirror of https://github.com/reality/dbot.git synced 2024-12-18 08:32:42 +01:00
dbot/modules/users
2013-04-10 01:28:53 +00:00
..
api.js isIgnoring now belongs in ignore.api, changes in command to reflect this. ~ignore now operational for commands. [#331] 2013-04-10 01:28:53 +00:00
commands.js users module now tracks current nick, appropriate output in ~alias 2013-03-25 13:55:47 +00:00
config.json Merge git://github.com/reality/depressionbot into database. Also Users API now databankerised 2013-03-24 11:09:40 +00:00
pages.js Testing rolling week [#216] 2013-01-27 23:37:35 +00:00
README.md users emit for new users 2013-01-24 19:29:13 +00:00
strings.json users module now tracks current nick, appropriate output in ~alias 2013-03-25 13:55:47 +00:00
usage.json give users module proper usage info, subsequently fix empty params erroring 2013-03-21 02:58:40 -04:00
users.js Provisional/example ~ignore functionality using databank [#331] 2013-04-09 00:10:08 +00:00

Users

Track users.

Description

This module tracks users and their aliases through nick changes and all that kind of thing. Its mainly a utility module for other modules to use. Its also totally !insaned.

Commands

~alias [user]

If an alias is provided, this command will return the primary user for which this is an alias for. If a primary user is provided, it will return a confirmation of this fact and a count of how many aliases belong to the user.

~setaliasparent [newparent]

Set a nick which is currently serving as an alias to the primary user, while setting what was previously the primary user as an alias of the new primary user. Requires moderator level access by default.

~mergeusers [primaryuser] [secondaryuser]

This command merges two nicks which are recorded as primary users into one user. The secondary user and all of their aliases will be merged under primaryuser. Requires moderator level access by default.

API

resolveUser(server, nick, [useLowerCase])

This resolves a given nick to its primary user and returns it.

Note that if the useLowerCase argument is set to true, it will do a lower-case search, however it will return the username in its properly capitalised form, so remember to lower case the return value if you are using lower case values as keys.

resolveUser(server, user)

Return whether a user is known either as an alias or a primary user.

isPrimaryUser(server, nick)

Return whether a nick is known as a primary user.

getAliases(server, user)

Return a list of aliases for a given primary user.

isOnline(server, user, channel, useLowerCase)

Return whether a user is online in a given channel on the given server.

Events

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.