From f2f046ca32bcacf3dddfd7a38d560300fb9c9b53 Mon Sep 17 00:00:00 2001 From: kiffer <> Date: Wed, 20 Jul 2005 11:44:31 +0000 Subject: Privmsg --- bot.pl | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/bot.pl b/bot.pl index 486765f..341a67c 100644 --- a/bot.pl +++ b/bot.pl @@ -1,22 +1,4 @@ #!/usr/bin/perl -# -# ircbot.pl written by detour@metalshell.com -# -# This irc bot will handle and print the motd, users on a channel -# joins, parts, quits, nick changes, and public msgs's. -# -# You can bind a sub to any numeric reply by using irc_. -# For example 376 is the RPL_ENDOFMOTD, so to catch this response -# you add irc_376 => \&your_sub to your session. -# -# This requires that you have POE and POE::Component::IRC -# installed. A simple way to do this is using the cpan module. -# perl -MCPAN -eshell -# cpan> install POE -# cpan> install POE::Component::IRC -# -# http://www.metalshell.com - use strict; @@ -33,7 +15,9 @@ POE::Session->new ( _start => \&irc_start, irc_376 => \&irc_connect, #end of motd irc_372 => \&irc_motd, irc_353 => \&irc_names, - irc_public => \&irc_pub_msg, ); + irc_public => \&irc_pub_msg, + irc_msg => \&irc_priv_msg, +); sub irc_start { # KERNEL, HEAP, and SESSION are constants exported by POE @@ -115,5 +99,9 @@ sub irc_pub_msg{ print "$channel: <$nick> $msg\n"; } +sub irc_priv_msg{ + print "Got a PM\n"; +} + #start everything $poe_kernel->run(); -- cgit v1.2.3