From 15bdb198c3736d9db6a6e2eec84296922789fd64 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Thu, 9 Mar 2017 12:40:18 +1300 Subject: Add multi-channel join command --- saxrobot | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/saxrobot b/saxrobot index 5854bf5..2f8b08c 100755 --- a/saxrobot +++ b/saxrobot @@ -113,11 +113,12 @@ sub irc_msg { } } if ($what =~ /^join\s/) { - my ($channel) = $what =~ /^join\s+(\S+)$/; - if ($channel) { - $irc->yield(join => $channel); + if ($what =~ /^join(\s+(\S+))+$/) { + $what =~ s/^join\s+//; + my @channels = split /\s+/, $what; + $irc->yield(join => $_) for @channels; } else { - $irc->yield(privmsg => $nick => "Syntax: join "); + $irc->yield(privmsg => $nick => "Syntax: join [channel2 ...]"); } } if ($what =~ /^say\s/) { -- cgit v1.1