6 use base qw(Bot::BasicBot);
8 $Expect::Log_Stdout = 0;
9 $Expect::Multiline_Matching = 0;
10 my $command = 'monop';
14 $exp->spawn($command, ()) or die "Cannot spawn $command: $!\n";
19 # returns output from command
21 my @results = $exp->expect($timeout, -re => '^[\n\s[:print:]]+$');
22 my ($pos, $error, $match, $before, $after) = @results;
23 return $before.$match.$after;
28 my $arguments = shift;
29 @nicks = keys(%{$arguments->{names}});
34 my $arguments = shift;
35 my $nick = $arguments->{who};
36 if ($nick eq $self->pocoirc->nick_name()) { # bot itself joins
45 my $arguments = shift;
46 if (scalar(@nicks) && grep /^$arguments->{who}$/, @nicks) {
47 print $exp "$arguments->{body}\n";
56 my $bot = MonopBot->new(
57 server => 'irc.example.com',
59 channels => ['#perl105'],
64 local $SIG{INT} = sub {
66 print "Quitting program...\n";
67 $bot->shutdown("Quitting...");