The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

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

SYNOPSIS

package Bot::Cobalt::Plugin::User::MyPlugin;

## Import useful stuff:
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.

strictures are also enabled. This will turn on 'strict' and make (most) warnings fatal.

Try::Tiny is always imported.

Exported

Constants

Moo types

All of the Types::Standard and List::Objects::Types types are exported.

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
secs_to_str_y

Carp

Warnings

carp

Errors

croak
confess

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, secs_to_str, and secs_to_str_y from Bot::Cobalt::Utils.

types

Exports all Type::Tiny types from List::Objects::Types and Types::Standard.

validate

Exports is_valid_nick_name and is_valid_chan_name from IRC::Utils.

AUTHOR

Jon Portnoy <avenj@cobaltirc.org>