From 1fa355a0a01751f5914c7cdcc3cac1eb470a10c2 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Tue, 7 Mar 2017 15:02:34 +1300 Subject: Add simple join/part to remote control --- saxrobot | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/saxrobot b/saxrobot index da51f8f..ae7e4f3 100755 --- a/saxrobot +++ b/saxrobot @@ -92,6 +92,22 @@ sub irc_msg { $irc->yield(privmsg => $nick => "I am bot, go away"); return; } + if ($what =~ /^part\s/) { + my ($channel) = $what =~ /^part\s+(\S+)$/; + if ($channel) { + $irc->yield(part => $channel); + } else { + $irc->yield(privmsg => $nick => "Syntax: part "); + } + } + if ($what =~ /^join\s/) { + my ($channel) = $what =~ /^join\s+(\S+)$/; + if ($channel) { + $irc->yield(join => $channel); + } else { + $irc->yield(privmsg => $nick => "Syntax: join "); + } + } if ($what =~ /^say\s/) { my ($channel, $message) = $what =~ /^say\s+(\S+)\s(.*)$/; if ($channel and $message) { -- cgit v1.1