App-RoboBot

 view release on metacpan or  search on metacpan

lib/App/RoboBot/Plugin.pm  view on Meta::CPAN

package App::RoboBot::Plugin;
$App::RoboBot::Plugin::VERSION = '4.004';
use v5.20;

use namespace::autoclean;

use Moose;
use MooseX::SetOnce;

use Data::Dumper;
use Log::Log4perl;
use Scalar::Util qw( blessed );

has 'name' => (
    is  => 'ro',
    isa => 'Str',
);

has 'description' => (
    is        => 'ro',
    isa       => 'Str',
    predicate => 'has_description',
);

has 'commands' => (
    is      => 'ro',
    isa     => 'HashRef',
    default => sub { return {} },
);

has 'before_hook' => (
    is        => 'ro',
    isa       => 'Str',
    predicate => 'has_before_hook',
);

has 'after_hook' => (
    is        => 'ro',
    isa       => 'Str',
    predicate => 'has_after_hook',
);

has 'bot' => (
    is     => 'rw',
    isa    => 'App::RoboBot',
    traits => [qw( SetOnce )],
);

has 'log' => (
    is        => 'rw',
    predicate => 'has_logger',
);

sub BUILD {
    my ($self) = @_;

    $self->log(Log::Log4perl::get_logger('plugin.'.$self->ns)) unless $self->has_logger;
}

sub init {
    my ($self, $bot) = @_;
}

sub post_init {
    my ($self, $bot) = @_;



( run in 0.712 second using v1.01-cache-2.11-cpan-39bf76dae61 )