Added API::IRC::quit

This commit is contained in:
Matthew Barksdale committed 2011-01-20 02:22:58 -05:00
1 parent 78ed4d39c3
commit 0b8054cbae
2 files changed
+15 -2

No files matched your search

+1 -1
View File
@@ -3,7 +3,7 @@ Auto IRC Bot 3.0: Change Log
3.0 Indev
==================================================================
* Added mode, privmsg, and notice subroutine to API::IRC.
* Added mode, privmsg, notice, and quit subroutine to API::IRC.
* Added PASS support.
* Bug fix: err() fatal errors now work. They didn't work
due to bad regex.
+14 -1
View File
@@ -9,7 +9,7 @@ use warnings;
use Exporter;
our @ISA = qw(Exporter);
our @EXPORT_OK = qw(cjoin cpart mode privmsg notice);
our @EXPORT_OK = qw(cjoin cpart mode privmsg notice quit);
# Join a channel.
@@ -51,3 +51,16 @@ sub notice {
Auto::socksnd($svr, "NOTICE $target :$message");
}
# Quit IRC
sub quit {
my ($svr, $reason) = @_;
if (defined $reason) {
Auto::socksnd($svr, "QUIT :$reason");
}
else {
Auto::socksnd($svr, "QUIT :Leaving");
}
}