aboutsummaryrefslogtreecommitdiff
path: root/saxrobot
diff options
context:
space:
mode:
Diffstat (limited to 'saxrobot')
-rwxr-xr-xsaxrobot12
1 files changed, 9 insertions, 3 deletions
diff --git a/saxrobot b/saxrobot
index 05a4315..2928d19 100755
--- a/saxrobot
+++ b/saxrobot
@@ -102,11 +102,17 @@ sub irc_msg {
}
}
if ($what =~ /^part\s/) {
- my ($channel) = $what =~ /^part\s+(\S+)$/;
+ my $message;
+ my ($channel, $message) = $what =~ /^part\s+(\S+)(\s(.*))?$/;
if ($channel) {
- $irc->yield(part => $channel);
+ if (!$message) {
+ $message = "commanded by $nick";
+ } else {
+ $message =~ s/^\s+//;
+ }
+ $irc->yield(part => $channel => $message);
} else {
- $irc->yield(privmsg => $nick => "Syntax: part <channel>");
+ $irc->yield(privmsg => $nick => "Syntax: part [partmsg]");
}
}
if ($what =~ /^join\s/) {