aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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");