Adam
view release on metacpan or search on metacpan
lib/Adam.pm view on Meta::CPAN
traits => ['Getopt'],
cmd_flag => 'owner',
builder => 'default_owner',
);
sub default_owner { 'perigrin!~perigrin@217.168.150.167' }
has username => (
isa => 'Str',
accessor => 'get_username',
traits => ['Getopt'],
cmd_flag => 'username',
builder => 'default_username',
);
sub default_username { 'adam' }
has password => (
isa => 'Str',
accessor => 'get_password',
traits => ['Getopt'],
cmd_flag => 'password',
builder => 'default_password',
);
sub default_password { '' }
has flood => (
isa => 'Bool',
reader => 'can_flood',
traits => ['Getopt'],
cmd_flag => 'flood',
builder => 'default_flood',
);
sub default_flood { 0 }
has plugins => (
isa => 'HashRef',
traits => [ 'Hash', 'NoGetopt' ],
lazy => 1,
auto_deref => 1,
builder => 'default_plugins',
handles => {
plugin_names => 'keys',
get_plugin => 'get',
has_plugins => 'count'
}
);
sub core_plugins {
return {
'Core_Connector' => 'POE::Component::IRC::Plugin::Connector',
'Core_BotAddressed' => 'POE::Component::IRC::Plugin::BotAddressed',
'Core_AutoJoin' => POE::Component::IRC::Plugin::AutoJoin->new(
Channels => { map { $_ => '' } @{ $_[0]->get_channels } },
),
'Core_NickReclaim' =>
POE::Component::IRC::Plugin::NickReclaim->new( poll => 30 ),
};
}
sub custom_plugins { {} }
sub default_plugins {
return { %{ $_[0]->core_plugins }, %{ $_[0]->custom_plugins } };
}
has plugin_manager => (
isa => 'POE::Component::IRC::Plugin::PlugMan',
is => 'ro',
lazy_build => 1,
);
sub _build_plugin_manager {
POE::Component::IRC::Plugin::PlugMan->new(
botowner => $_[0]->get_owner,
debug => 1
);
}
before 'START' => sub {
my ($self) = @_;
$self->plugin_add( 'PlugMan' => $self->plugin_manager );
};
has poco_irc_args => (
isa => 'HashRef',
accessor => 'get_poco_irc_args',
traits => [ 'Hash', 'Getopt' ],
cmd_flag => 'extra_args',
builder => 'default_poco_irc_args',
);
sub default_poco_irc_args {
{};
}
has poco_irc_options => (
isa => 'HashRef',
accessor => 'get_poco_irc_options',
traits => [ 'Hash', 'Getopt' ],
cmd_flag => 'extra_args',
builder => 'default_poco_irc_options',
);
sub default_poco_irc_options { { trace => 0 } }
has _irc => (
isa => 'POE::Component::IRC',
( run in 0.482 second using v1.01-cache-2.11-cpan-39bf76dae61 )