]> ruin.nu Git - NDIRC.git/blobdiff - Commands/Basic.pm
say and cmd commands for better bot control
[NDIRC.git] / Commands / Basic.pm
index f0404876f1bba0e4a08093a054b3bf320ba719a0..fd30f0f728ec4b5aad9302e591166eadd6073211 100644 (file)
@@ -59,5 +59,26 @@ sub help
                . "Instead of . you can use ! to get reply in pm or ~ to get reply in channel.");
 }
 
+sub say
+       : Help(.say target message | sends message to target)
+       : Type(pm)
+       : ACL(irc_say)
+{
+       my ($self, $c, $msg) = @_;
+       my ($target,$message) = $msg =~ /^(\S+)\s+(.+)$/ or die 'ARGS';
+
+       $c->message(privmsg => $target => $message );
+}
+
+sub cmd
+       : Help(.run command args | run a given command)
+       : Type(pm)
+       : ACL(irc_cmd)
+{
+       my ($self, $c, $msg) = @_;
+
+       $c->command(split /\s/, $msg);
+}
+
 1;