diff options
author | David Phillips <david@sighup.nz> | 2017-09-21 12:58:59 +1200 |
---|---|---|
committer | David Phillips <david@sighup.nz> | 2017-09-21 12:58:59 +1200 |
commit | 2242e761b79740056fd4306841c6d548f800e2f0 (patch) | |
tree | 103707440a267da29e50d47d4adca1cd1d894994 /idalius.pl | |
parent | e8db6cdecd3f18133e318df63b463e4c5c2adfc4 (diff) | |
download | idalius-2242e761b79740056fd4306841c6d548f800e2f0.tar.xz |
Add action command
Diffstat (limited to 'idalius.pl')
-rwxr-xr-x | idalius.pl | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -139,6 +139,7 @@ sub irc_msg { $irc->yield(privmsg => $nick => "I am bot, go away"); return; } + # FIXME this needs tidying. Some of this can be factored out, surely. if ($what =~ /^nick\s/) { my ($newnick) = $what =~ /^nick\s+(\S+)$/; if ($newnick) { @@ -182,6 +183,15 @@ sub irc_msg { $irc->yield(privmsg => $nick => "Syntax: say <channel> <msg>"); } } + if ($what =~ /^action\s/) { + my ($channel, $action) = $what =~ /^action\s+(\S+)\s(.*)$/; + if ($channel and $action) { + $irc->yield(ctcp => $channel => "ACTION $action"); + $irc->yield(privmsg => $nick => "Requested."); + } else { + $irc->yield(privmsg => $nick => "Syntax: action <channel> <action text>"); + } + } if ($what =~ /^reconnect/) { my ($reason) = $what =~ /^reconnect\s+(.+)$/; $irc->yield(privmsg => $nick => "Doing that now"); |