Daisuke Maki > Morris-0.01000_01 > Morris::Plugin

Download:
Morris-0.01000_01.tar.gz

Dependencies

Annotate this POD

Source  

NAME ^

Morris::Plugin - Base Class For Morris Plugin

SYNOPSIS ^

    package MyPlugin;
    use Moose;
    use namespace::clean -except => qw(meta);

    extends 'Morris::Plugin';

    after register => sub {
        my ($self, $conn) = @_;

        # Do whatever initialization requied

        # Register which hook you want to respond to 
        $conn->register_hook(
            'chat.privmsg',  # hook name
            sub {
                my $msg = shift;
                # Do whatever
            }
        );
    };
syntax highlighting: