irc_join => \&on_join,
irc_part => \&on_part,
irc_quit => \&on_quit,
+ irc_notice => \&on_irc_notice,
irc_ping => \&on_ping,
autoping => \&do_autoping,
irc_error => \&on_error,
}
+# on_irc_notice()
+#
+# output irc notices to commandchannel
+#
+sub on_irc_notice {
+ my ($sender, $kernel, $heap, $who, $notice) = @_[SENDER, KERNEL, HEAP, ARG0, ARG2];
+
+ my $nick = ( split /!/, $who )[0];
+ my $irc = $sender->get_heap();
+ my $session = find_irc_session($irc);
+
+ switch ($notice) {
+ case(/^NickServ/) {}
+ case(/^ChanServ/) {}
+ case(/\.freenode\.net/i) {}
+ else {
+ # send to commandchannel
+ my $text = 'irc notice on session ' . $irc->nick_name() . ' from: ' . $nick;
+ send_to_commandchannel($text);
+ $text = 'text: ' . $notice;
+ send_to_commandchannel($text);
+ }
+ }
+}
+
+
## http://poe.perl.org/?POE_Cookbook/IRC_Bot_Debugging
## http://poe.perl.org/?POE_Cookbook/IRC_Bot_Disconnecting
## http://poe.perl.org/?POE_Cookbook/IRC_Bot_Reconnecting