]> git.donarmstrong.com Git - infobot.git/blobdiff - src/CommandStubs.pl
plug.org, there should be a general xml news app...
[infobot.git] / src / CommandStubs.pl
index c83d46a6cc1746c4757dd75e4f3b37bddf146a40..32e1005733da8c0b3312cdd8d5ded63b4f465716 100644 (file)
@@ -3,9 +3,9 @@
 # WARN: this file does not reload on HUP.
 #
 
-if (&IsParam("useStrict")) { use strict; }
+#use strict;
 
-$babel_lang_regex = "fr|sp|po|pt|it|ge|de|gr|en";
+$babel_lang_regex = "fr|sp|es|po|pt|it|ge|de|gr|en|zh|ja|jp|ko|kr|ru";
 
 ### COMMAND HOOK IMPLEMENTATION.
 # addCmdHook("SECTION", 'TEXT_HOOK',
@@ -208,6 +208,9 @@ sub parseCmdHook {
 &addCmdHook("extra", 'slashdot', ('CODEREF' => 'Slashdot::Slashdot',
        'Identifier' => 'slashdot', 'Forker' => 1,
        'Cmdstats' => 'Slashdot') );
+&addCmdHook("extra", 'plug', ('CODEREF' => 'Plug::Plug',
+       'Identifier' => 'plug', 'Forker' => 1,
+       'Cmdstats' => 'Plug') );
 &addCmdHook("extra", 'uptime', ('CODEREF' => 'uptime', 'Identifier' => 'uptime',
        'Cmdstats' => 'Uptime') );
 &addCmdHook("extra", 'nullski', ('CODEREF' => 'nullski', ) );
@@ -215,6 +218,21 @@ sub parseCmdHook {
        'Identifier' => 'freshmeat', 'Cmdstats' => 'Freshmeat',
        'Forker' => 1, 'Help' => 'freshmeat') );
 &addCmdHook("extra", 'verstats', ('CODEREF' => 'do_verstats' ) );
+&addCmdHook("extra", 'weather', ('CODEREF' => 'Weather::Weather',
+       'Identifier' => 'weather', 'Help' => 'weather',
+       'Cmdstats' => 'Weather') );
+&addCmdHook("extra", 'bzflist', ('CODEREF' => 'BZFlag::list',
+       'Identifier' => 'bzflag', 'Cmdstats' => 'BZFlag',
+       'Forker' => 1) );
+&addCmdHook("extra", 'bzfquery', ('CODEREF' => 'BZFlag::query',
+       'Identifier' => 'bzflag', 'Cmdstats' => 'BZFlag',
+       'Forker' => 1, 'Help' => 'bzflag') );
+&addCmdHook("extra", 'zfi', ('CODEREF' => 'zfi::query',
+       'Identifier' => 'zfi', 'Cmdstats' => 'zfi',
+       'Forker' => 1) );
+&addCmdHook("extra", 'zsi', ('CODEREF' => 'zsi::query',
+       'Identifier' => 'zsi', 'Cmdstats' => 'zsi',
+       'Forker' => 1) );
 
 ###
 ### END OF ADDING HOOKS.
@@ -232,9 +250,9 @@ sub Modules {
                ^\s*
                (?:babel(?:fish)?|x|xlate|translate)
                \s+
-               (to|from)               # direction of translation (through)
+               ($babel_lang_regex)\w*  # from language?
                \s+
-               ($babel_lang_regex)\w*  # which language?
+               ($babel_lang_regex)\w*  # to language?
                \s*
                (.+)                    # The phrase to be translated
     }xoi) {
@@ -280,6 +298,11 @@ sub Modules {
        $itc =~ s/([^\w\s])/\\$1/g;
        my $z = join '|', split ' ', $itc;
 
+       if ($msgType eq "privmsg" and $message =~ / ($mask{chan})$/) {
+           &DEBUG("ircTC: privmsg detected; chan = $1");
+           $chan = $1;
+       }
+
        if ($message =~ /^_stats(\s+(\S+))$/i) {
            &textstats_main($2);
            return;
@@ -524,7 +547,7 @@ sub Modules {
            $reply .= ".  Started the scan ".&Time2String(time() - $wingaterun)." ago";
        }
 
-       &performStrictReply("$reply.");
+       &pSReply("$reply.");
 
        return;
     }
@@ -567,6 +590,11 @@ sub seen {
     my($person) = lc shift;
     $person =~ s/\?*$//;
 
+    if (&whatInterface() !~ /IRC/) {
+       &status("seen disabled in CLI.");
+       return;
+    }
+
     if (!defined $person or $person =~ /^$/) {
        &help("seen");
 
@@ -740,7 +768,7 @@ sub lart {
 }
 
 sub DebianNew {
-    my $idx   = "debian/Packages-woody.idx";
+    my $idx   = "debian/Packages-sid.idx";
     my $error = 0;
     my %pkg;
     my @new;
@@ -749,7 +777,7 @@ sub DebianNew {
     $error++ unless ( -e "$idx-old");
 
     if ($error) {
-       $error = "no woody/woody-old index file found.";
+       $error = "no sid/sid-old index file found.";
        &ERROR("Debian: $error");
        &msg($who, $error);
        return;
@@ -772,11 +800,11 @@ sub DebianNew {
        next if (/^\*/);
        next if (exists $pkg{$_});
 
-       push(@new);
+       push(@new, $_);
     }
     close IDX1;
 
-    &::performStrictReply( &::formListReply(0, "New debian packages:", @new) );
+    &::pSReply( &::formListReply(0, "New debian packages:", @new) );
 }
 
 sub do_verstats {
@@ -797,7 +825,7 @@ sub do_verstats {
        return;
     }
 
-    &msg($who, "Sending CTCP VERSION to #chan...");
+    &msg($who, "Sending CTCP VERSION to #$chan...");
     $conn->ctcp("VERSION", $chan);
     $cache{verstats}{chan}     = $chan;
     $cache{verstats}{who}      = $who;