NAME

Bot::Cobalt::Common - Import commonly-used tools and constants

SYNOPSIS

package Bot::Cobalt::Plugin::User::MyPlugin;
our $VERSION = '0.10';

## Import useful stuff from:
##  IRC::Utils
##  Bot::Cobalt::Utils
##  Object::Pluggable::Constants
## also get strict + warnings
use Bot::Cobalt::Common;

DESCRIPTION

This is a small exporter module providing easy inclusion of commonly used tools and constants to make life easier on plugin authors.

By default, strict and warnings are also enabled.

Exported

Constants

Moo types

All of the MooX::Types::MooseLike::Base types are exported.

See MooX::Types::MooseLike::Base for details.

IRC::Utils

See IRC::Utils for details.

decode_irc
lc_irc uc_irc eq_irc
strip_color strip_formatting

Hostmasks

parse_user
normalize_mask 
matches_mask

Nicknames and channels

is_valid_nick_name
is_valid_chan_name

Bot::Cobalt::Utils

See Bot::Cobalt::Utils for details.

String-related

rplprintf
color

Globs and matching

glob_to_re
glob_to_re_str 
glob_grep

Passwords

mkpasswd
passwdcmp

Time parsing

timestr_to_secs
secs_to_timestr
secs_to_str

Carp

Warnings

carp

Errors

confess
croak

Exported tags

You can load groups of commands by importing named tags:

use Bot::Cobalt::Common qw/ :types :string /;

constant

Exports PLUGIN_EAT_NONE, PLUGIN_EAT_ALL constants from Object::Pluggable.

errors

Exports carp, croak, and confess from Carp.

host

Exports parse_user, normalize_mask, and matches_mask from IRC::Utils.

passwd

Exports mkpasswd and passwdcmp from App::bmkpasswd.

string

Exports from Bot::Cobalt::Utils: color, rplprintf, glob_to_re, glob_to_re_str, glob_grep

Exports from IRC::Utils: lc_irc, eq_irc, uc_irc, decode_irc, strip_color, strip_formatting

time

Exports timestr_to_secs, secs_to_timestr, and secs_to_str from Bot::Cobalt::Utils.

types

Exports the Moo types from MooX::Types::MooseLike::Base.

validate

Exports is_valid_nick_name and is_valid_chan_name from IRC::Utils.

AUTHOR

Jon Portnoy <avenj@cobaltirc.org>