aboutsummaryrefslogtreecommitdiff
path: root/saxrobot
diff options
context:
space:
mode:
authorDavid Phillips <david@sighup.nz>2017-03-09 11:27:03 +1300
committerDavid Phillips <david@sighup.nz>2017-03-09 11:27:03 +1300
commit926886e054edd1dd67e3195416c1c183f3850946 (patch)
tree1ef1e3aca17f01cdd01fa029766e12fbe3060191 /saxrobot
parent51a140854c757f81cc7bc9b90a0175e185ec0e0e (diff)
downloadidalius-926886e054edd1dd67e3195416c1c183f3850946.tar.xz
Add message/reason to part command
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/) {