aboutsummaryrefslogtreecommitdiff
path: root/idalius.pl
diff options
context:
space:
mode:
authorDavid Phillips <david@sighup.nz>2017-09-21 12:58:59 +1200
committerDavid Phillips <david@sighup.nz>2017-09-21 12:58:59 +1200
commit2242e761b79740056fd4306841c6d548f800e2f0 (patch)
tree103707440a267da29e50d47d4adca1cd1d894994 /idalius.pl
parente8db6cdecd3f18133e318df63b463e4c5c2adfc4 (diff)
downloadidalius-2242e761b79740056fd4306841c6d548f800e2f0.tar.xz
Add action command
Diffstat (limited to 'idalius.pl')
-rwxr-xr-xidalius.pl10
1 files changed, 10 insertions, 0 deletions
diff --git a/idalius.pl b/idalius.pl
index 9529c67..5b7db29 100755
--- a/idalius.pl
+++ b/idalius.pl
@@ -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");