Adam

 view release on metacpan or  search on metacpan

lib/Moses.pm  view on Meta::CPAN

        my ( $self, $nickstr, $channel, $msg ) = @_[ OBJECT, ARG0, ARG1, ARG2 ];
        my ($nick) = split /!/, $nickstr;
        $self->privmsg( $channel => "$nick: ${ \$self->message }" );
    };

    # Run with POE (default)
    __PACKAGE__->run unless caller;

    # Or run with IO::Async (requires IO::Async::Loop::POE)
    # __PACKAGE__->async unless caller;

=head1 DESCRIPTION

Moses is declarative sugar for building IRC bots based on the L<Adam> IRC bot
framework. Moses is designed to minimize the amount of work you have to do to
make an IRC bot functional, and to make the process as declarative as possible.

Bots can run in two modes: the default L<POE> event loop via C<run()>, or an
L<IO::Async> mode via C<async()> that enables integration with
L<IO::Async>-based components such as L<Net::Async::MCP> or
L<Net::Async::HTTP>. The async mode requires L<IO::Async::Loop::POE>.

=head2 nickname

    nickname 'sample-bot';

Set the nickname for the bot. Defaults to the current package name.

=head2 server

    server 'irc.perl.org';

Set the IRC server for the bot to connect to.

=head2 port

    port 6667;

Set the port for the bot's server. Defaults to C<6667>.

=head2 channels

    channels '#bots', '#perl';

Supply a list of channels for the bot to join upon connecting.

=head2 plugins

    plugins MyPlugin => 'MyBot::Plugin::Foo';

Extra L<POE::Component::IRC::Plugin> objects or class names to load into the bot.

=head2 username

    username 'mybot';

The username to use for IRC connection.

=head2 password

    password 'secret';

The server password to use for IRC connection.

=head2 flood

    flood 1;

Disable flood protection. Defaults to false.

=head2 owner

    owner 'nick!user@host';

The hostmask of the owner of the bot. The owner can control the bot's plugins
through IRC using the L<POE::Component::IRC::Plugin::PlugMan> interface.

=head2 poco_irc_args

    poco_irc_args LocalAddr => '127.0.0.1';

Extra arguments to pass to the IRC component constructor.

=head2 poco_irc_options

    poco_irc_options trace => 1;

Options to pass to the IRC component constructor.

=head1 SUPPORT

=head2 Issues

Please report bugs and feature requests on GitHub at
L<https://github.com/perigrin/adam-bot-framework/issues>.

=head2 IRC

Join C<#ai> on C<irc.perl.org> or message Getty directly.

=head1 CONTRIBUTING

Contributions are welcome! Please fork the repository and submit a pull request.

=head1 AUTHORS

=over 4

=item *

Chris Prather <chris@prather.org>

=item *

Torsten Raudssus <torsten@raudssus.de>

=back

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2010 by Chris Prather, Torsten Raudssus.



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