diff options
author | David Phillips <david@sighup.nz> | 2017-03-09 12:40:18 +1300 |
---|---|---|
committer | David Phillips <david@sighup.nz> | 2017-03-09 12:40:18 +1300 |
commit | 15bdb198c3736d9db6a6e2eec84296922789fd64 (patch) | |
tree | 28184a8d0b3fb9226b626972ca5bbf4035aefe0b | |
parent | 3684b7b78b3098b55a010a10668621cd26074685 (diff) | |
download | idalius-15bdb198c3736d9db6a6e2eec84296922789fd64.tar.xz |
Add multi-channel join command
-rwxr-xr-x | saxrobot | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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 <channel>"); + $irc->yield(privmsg => $nick => "Syntax: join <channel1> [channel2 ...]"); } } if ($what =~ /^say\s/) { |