The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

App::Wubot::Reactor::User - try to identify user from the 'username' field

VERSION

version 0.3.1

SYNOPSIS

      - name: user
        plugin: User

DESCRIPTION

The user reactor will parse the username field.

The original user id will always be preserved in the username_orig field. If the username_orig field already exists, it will not be overwritten.

If the username field contains an email address (e.g. the from on an mbox monitor message), then the domain will be captured into the username_domain field. If the email contains a full name it will be captured into username_full. Any leading or trailing quotes or spaces will be removed from the full username field.

Commonly usernames in IRC may contain some comment such as username|idle or username{idle}. Any such comments will be extracted into the username_comment field.

Any remaining text will be left in the username field.

After this plugin has reacted on the message, you may want to send it through the Icon reactor to determine if there is an appropriate icon for the user in your images directory. For more information, please see the 'notifications' document.

USER DATABASE

The user database is still under construction.

You can define information about your contacts in:

  ~/wubot/userdb/{username}.yaml

Here is an example:

  ~/wubot/userdb/dude.yaml

  ---
  color: green
  aliases:
    lebowski: {}
    'El Duderino': {}
  image: dude.png

If you define a 'color' or an 'image', then any messages that match the username will have those values set in the message. This will override any pre-existing 'color' or 'image' fields.

You can define any aliases for your user in the 'aliases' section of the config. This allows you to recognize the same user in case they have different usernames for email, twitter, etc. The 'username' field will be updated to use the username from the file name. If the username is modified, the original username will be stored in the 'username_orig' field.

Using the example above, if a message had the username set to 'lebowski', then the following fields would be set on the message:

  username: dude
  username_orig: lebowski
  color: green
  image: dude.png

SUBROUTINES/METHODS

react( $message, $config )

The standard reactor plugin react() method.