]> ruin.nu Git - NDIRC.git/blobdiff - Bot.pm
Log notices, need POE::Component::IRC 6.16
[NDIRC.git] / Bot.pm
diff --git a/Bot.pm b/Bot.pm
index 1200424a94cfba04219b6415cc1dfd685ce222e2..dde08adc2b42ff6dc1acaf027b51f686ef990905 100644 (file)
--- a/Bot.pm
+++ b/Bot.pm
@@ -24,6 +24,7 @@ use feature ':5.10';
 
 use Moose;
 
+use POE::Component::IRC::Common qw/irc_to_utf8/;
 use POE::Session;
 use POE::Component::IRC::Plugin::Logger;
 use POE::Component::IRC::Plugin::BotTraffic;
@@ -79,11 +80,12 @@ sub _start {
                Sort_by_date => 1,
                Strip_color => 1,
                Strip_formatting => 1,
+               Notices => 1,
        ));
 
        $heap->{connector} = POE::Component::IRC::Plugin::Connector->new(
-               servers => ['irc.netgamers.org', 'underworld.no.eu.netgamers.org'
-                       ,'firefly.no.eu.netgamers.org', 'underworld.ca.us.netgamers.org' ]
+               servers => [['irc.netgamers.org'], ['underworld.no.eu.netgamers.org']
+                       ,['firefly.no.eu.netgamers.org'], ['underworld.ca.us.netgamers.org'] ]
        );
        $irc->plugin_add( 'Connector' => $heap->{connector} );
 
@@ -196,16 +198,18 @@ sub irc_001 {
 }
 
 sub irc_invite {
-       my ($self,$sender, $who, $channel) = @_[OBJECT,SENDER, HEAP, ARG0 .. ARG1];
+       my ($self,$sender, $who, $channel) = @_[OBJECT,SENDER, ARG0 .. ARG1];
        my $irc = $sender->get_heap();
 
        $irc->yield( join => $_ ) for grep /^$channel$/i, keys %{$self->disp->channels}
 }
 
 sub irc_public {
+       $_[ARG2] = irc_to_utf8 $_[ARG2];
 }
 
 sub irc_msg {
+       $_[ARG2] = irc_to_utf8 $_[ARG2];
 }
 
 sub  refresh {