X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=Commands%2FBasic.pm;h=6517e384b94660353a53209b424a8ea1b41420ee;hb=726b4c0ff9accf03aac73e14d6aee8742bc95c92;hp=1249f201586bc6155be184807f3ddee1697196bb;hpb=52aa24ac076b97096ff29e7a59331654620f230c;p=NDIRC.git diff --git a/Commands/Basic.pm b/Commands/Basic.pm index 1249f20..6517e38 100644 --- a/Commands/Basic.pm +++ b/Commands/Basic.pm @@ -25,6 +25,7 @@ use NDIRC::Dispatcher; command commands => { help => q(commands | 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); } } }; @@ -59,7 +58,7 @@ command help => { command say => { help => q(.say target message | sends message to target), - type => q(pm), + type => q(ircpm), acl => q(irc_say), }, class extends NDIRC::Command { method execute ($c,$msg) { @@ -71,7 +70,7 @@ command say => { command cmd => { help => q(.cmd command args | run a given irc command), - type => q(pm), + type => q(ircpm), acl => q(irc_cmd), }, class extends NDIRC::Command { method execute ($c,$msg) { @@ -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, "$mess (reply with /msg " + .$c->channel.")"); + $c->message(privmsg => $c->channel, "$target << $mess"); + } +}; + + 1;