From a7c02881a10c6e61d37263cf1d423c27e37c6456 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Thu, 9 Mar 2017 11:37:31 +1300 Subject: Implement rough multi-channel parts --- saxrobot | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'saxrobot') 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]"); } -- cgit v1.1