POE::Component::IRC::Plugin::CoinFlip is a Perl module, a POE::Component::IRC plugin which uses POE::Component::IRC::Plugin for its base. It provides interface to "flip" coins (heads or tails) on IRC. It accepts input from public channel events, /notice messages as well as /msg (private messages); although that can be configured at will.
SYNOPSIS
use strict;
use warnings;
use POE qw(Component::IRC Component::IRC::Plugin::CoinFlip);
my $irc = POE::Component::IRC->spawn(
nick => 'CoinBot',
server => 'irc.freenode.net',
port => 6667,
ircname => 'CoinBot',
);
POE::Session->create(
package_states => [
main => [ qw(_start irc_001) ],
],
);
$poe_kernel->run;
sub _start {
$irc->yield( register => 'all' );
$irc->plugin_add(
'CoinFlip' =>
POE::Component::IRC::Plugin::CoinFlip->new
);
$irc->yield( connect => {} );
}
sub irc_001 {
$irc->yield( join => '#zofbot' );
}
Zoffix > CoinBot, flip
< CoinBot > Zoffix, heads
< Zoffix > CoinBot, flip
< CoinBot > Zoffix, tails
Product's homepage
Requirements:
· Perl