]> ruin.nu Git - NDIRC.git/blobdiff - Commands/Basic.pm
Use discord channel id
[NDIRC.git] / Commands / Basic.pm
index 1249f201586bc6155be184807f3ddee1697196bb..d0570f6c432070d423735d4ac6608ae4319fd420 100644 (file)
@@ -25,6 +25,7 @@ use NDIRC::Dispatcher;
 
 command commands => {
        help => q(commands <command> | Gives help about all available commands or lists all commands available in the current channel),
+       type => 'help',
 }, class extends NDIRC::Command {
        method execute ($c,$command) {
                unless($command){
@@ -38,9 +39,7 @@ command commands => {
                        }
                        $c->reply(join ', ', @commands);
                }elsif (exists $c->disp->commands->{$command}){
-                       for (@{$c->disp->commands->{$command}->help}){
-                               $c->reply($_);
-                       }
+                       $c->reply($c->disp->commands->{$command}->help);
                }
        }
 };
@@ -80,5 +79,20 @@ command cmd => {
        }
 };
 
+command anon => {
+       help => q(syntax: .anon nick message),
+       type => q(anon),
+       acl => q(irc_anon),
+}, class extends NDIRC::Command {
+       method execute($c,$msg) {
+               my ($target,$mess) = $msg =~ /^(\S+) (.*)$/ or die 'ARGS';
+
+               $c->message(privmsg => $target, "<b>$mess</b> <c04>(reply with /msg "
+                       .$c->channel.")</c>");
+               $c->message(privmsg => $c->channel, "<c03>$target << $mess</c>");
+       }
+};
+
+
 1;