aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Phillips <david@sighup.nz>2017-03-09 11:37:31 +1300
committerDavid Phillips <david@sighup.nz>2017-03-09 11:37:31 +1300
commita7c02881a10c6e61d37263cf1d423c27e37c6456 (patch)
treedf5944fefbfa24c785c93025414903b8f868afe0
parent926886e054edd1dd67e3195416c1c183f3850946 (diff)
downloadidalius-a7c02881a10c6e61d37263cf1d423c27e37c6456.tar.xz
Implement rough multi-channel parts
-rwxr-xr-xsaxrobot12
1 files changed, 4 insertions, 8 deletions
diff --git a/saxrobot b/saxrobot
index 2928d19..f208284 100755
--- a/saxrobot
+++ b/saxrobot
@@ -103,14 +103,10 @@ sub irc_msg {
}
if ($what =~ /^part\s/) {
my $message;
- my ($channel, $message) = $what =~ /^part\s+(\S+)(\s(.*))?$/;
- if ($channel) {
- if (!$message) {
- $message = "commanded by $nick";
- } else {
- $message =~ s/^\s+//;
- }
- $irc->yield(part => $channel => $message);
+ if ($what =~ /^part(\s+(\S+))+$/m) {
+ my @args = split /\s+/, $what;
+ print for @args;
+ $irc->yield(part => @args);
} else {
$irc->yield(privmsg => $nick => "Syntax: part [partmsg]");
}