From 79d464c24733165ee0e91660df9cf7494bedc101 Mon Sep 17 00:00:00 2001 From: Matthew Barksdale Date: Thu, 20 Jan 2011 02:05:50 -0500 Subject: [PATCH] Added API::IRC::msg and API::IRC::notice --- doc/CHANGELOG | 2 +- src/API/IRC.pm | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/doc/CHANGELOG b/doc/CHANGELOG index bee1f68..105b8b9 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -3,7 +3,7 @@ Auto IRC Bot 3.0: Change Log 3.0 Indev ================================================================== - * Added mode subroutine to API::IRC. + * Added mode, msg, and notice subroutine to API::IRC. * Added PASS support. * Bug fix: err() fatal errors now work. They didn't work due to bad regex. diff --git a/src/API/IRC.pm b/src/API/IRC.pm index c407fcf..cea1713 100644 --- a/src/API/IRC.pm +++ b/src/API/IRC.pm @@ -9,7 +9,7 @@ use warnings; use Exporter; our @ISA = qw(Exporter); -our @EXPORT_OK = qw(cjoin cpart mode); +our @EXPORT_OK = qw(cjoin cpart mode msg notice); # Join a channel. @@ -37,3 +37,17 @@ sub mode { Auto::socksnd($svr, "MODE $chan $modes"); } + +# Send a PRIVMSG +sub msg { + my ($svr, $target, $message) = @_; + + Auto::socksnd($svr, "PRIVMSG $target :$message"); +} + +# Send a NOTICE +sub notice { + my ($svr, $target, $message) = @_; + + Auto::socksnd($svr, "NOTICE $target :$message"); +}