3
0
mirror of https://github.com/reality/dbot.git synced 2024-12-25 04:02:39 +01:00
dbot/modules/users
Douglas Gardner a53eb5e0d2 begin transition from English to ISO-639 with #234
This patch converts all English language strings used within
depressionbot's localisation interface (that is, strings.json) to their
ISO-639-1 equivalents.

The purpose of this patch is to make the strings.json file less
English-dependent.

All languages with an ISO-639-1 code have been converted; that is,
English, Spanish and Welsh, to ``en``, ``es`` and ``cy`` respectively.

This patch does not attempt to force a solution to the issue of Na'vi:
the language does not have a large enough corpus to warrant its own ISO
639-3 code, and as such there is no perfect solution. For the time
being, this patch keeps the Na'vi language as its English language
string ("Na'vi"). A possible solution to this discrepancy includes using
the ISO 639-3 code ``art``, used for artificial languages that do not
qualify for an official code, or by using local use codes specified
in ISO 639-3 (qaa to qtz).

This patch requires collaboration with upstream repositories that also
use strings.json, such as the Github and Stats modules.
2013-02-12 18:39:15 +00:00
..
api.js users.api.getRandomChannelUser [#156] 2013-01-26 19:21:09 +00:00
commands.js hook for update poll nicks [#158][#166] also change mergeusers return api 2013-01-20 20:22:27 +00:00
config.json event in users for nick rename 2013-01-24 18:55:28 +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 begin transition from English to ISO-639 with #234 2013-02-12 18:39:15 +00:00
users.js Fixed second new_user event misfire 2013-02-03 16:49:10 +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.