Class | Irc::Bot::Auth::BotUser |
In: |
lib/rbot/botuser.rb
|
Parent: | Object |
This is the basic class for bot users: they have a username, a password, a list of netmasks to match against, and a list of permissions. A BotUser can be marked as ‘transient’, usually meaning it‘s not intended for permanent storage. Transient BotUsers have lower priority than nontransient ones for autologin purposes.
To initialize a BotUser, you pass a username and an optional hash of options. Currently, only two options are recognized:
transient: | true or false, determines if the BotUser is
transient or permanent (default is false, permanent BotUser).
Transient BotUsers are initialized by prepending an asterisk (*) to the username, and appending a sanitized version of the object_id. The username can be empty. A random password is generated. Permanent Botusers need the username as is, and no password is generated. |
masks: | an array of Netmasks to initialize the NetmaskList. This list is used as-is for
permanent BotUsers.
Transient BotUsers will alter the list elements which are Irc::User by globbing the nick and any initial nonletter part of the ident. The masks option is optional for permanent BotUsers, but obligatory (non-empty) for transients. |
login_by_mask | [W] | |
netmasks | [R] | |
password | [R] | |
perm | [R] | |
perm_temp | [R] | |
transient | [W] | |
username | [R] |
This method sanitizes a username by chomping, downcasing and replacing any nonalphanumeric character with _
Checks if BotUser is allowed to do something on channel chan, or on all channels if chan is nil