NAME
Adam - The patriarch of IRC Bots
VERSION
version 1.001
SYNOPSIS
See the Synopsis in Moses. Adam is not meant to be used directly.
DESCRIPTION
The Adam class implements an IRC bot based on POE::Component::IRC::State, Moose, and MooseX::POE. It supports two event loop modes: the default POE loop via run(), and an IO::Async mode via async() that allows integration with other IO::Async-based components through IO::Async::Loop::POE.
Adam is not meant to be used directly — see Moses for the declarative sugar layer.
logger
Logger object that implements the Adam::Logger::API role. Defaults to Adam::Logger::Default.
nickname
The IRC nickname for the bot. Defaults to the package name. Required.
server
The IRC server to connect to. Defaults to irc.perl.org. Required.
port
The port for the IRC server. Defaults to 6667.
channels
IRC channels to connect to. ArrayRef of channel names.
owner
The hostmask of the owner of the bot. The owner can control the bot's plugins through IRC using the POE::Component::IRC::Plugin::PlugMan interface.
username
The username to use for IRC connection. Defaults to adam.
password
The server password to use for IRC connection. Defaults to empty string.
flood
Disable flood protection. Defaults to 0 (false).
plugins
A HashRef of plugins associated with the IRC bot. See Moses::Plugin for more details.
core_plugins
Returns the core plugins that are loaded by default.
custom_plugins
Returns custom plugins to be loaded. Override this in subclasses.
default_plugins
Returns all plugins (core and custom) to be loaded.
plugin_manager
The POE::Component::IRC::Plugin::PlugMan instance for managing plugins.
poco_irc_args
A HashRef of extra arguments to pass to the IRC component constructor.
poco_irc_options
A HashRef of options to pass to the IRC component. Defaults to { trace => 0 }.
privmsg
$bot->privmsg($who, $what);
Send message $what as a private message to $who, a channel or nick.
load_plugin
$bot->load_plugin($name, $plugin);
Load a plugin with the given name.
run
MyBot->run;
# or
$bot->run;
Start the IRC bot using the POE event loop. This method also works as a class method and will instantiate the bot if called as such.
async
MyBot->async;
# or
$bot->async;
Start the IRC bot using IO::Async as the event loop. This allows you to integrate the bot with other IO::Async-based components. Requires IO::Async::Loop::POE to be installed.
This method also works as a class method and will instantiate the bot if called as such.
stop
$bot->stop;
Stop the bot's event loop. Works with both POE and IO::Async modes.
SUPPORT
Issues
Please report bugs and feature requests on GitHub at https://github.com/perigrin/adam-bot-framework/issues.
IRC
Join #ai on irc.perl.org or message Getty directly.
CONTRIBUTING
Contributions are welcome! Please fork the repository and submit a pull request.
AUTHORS
Chris Prather <chris@prather.org>
Torsten Raudssus <torsten@raudssus.de>
COPYRIGHT AND LICENSE
This software is copyright (c) 2010 by Chris Prather, Torsten Raudssus.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.