]> git.donarmstrong.com Git - infobot.git/blobdiff - src/CommandStubs.pl
- added weather from Nathan Moschkin <logeist@guinerd.myip.org>. Thanks!
[infobot.git] / src / CommandStubs.pl
index 520e326b743cd2da836b0b1c9c181a83ddc637e2..39833b589dc820bd98df508f9d8e3713ee82bc7d 100644 (file)
@@ -3,7 +3,7 @@
 # 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";
 
@@ -215,6 +215,9 @@ 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') );
 
 ###
 ### END OF ADDING HOOKS.
@@ -280,6 +283,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 +532,7 @@ sub Modules {
            $reply .= ".  Started the scan ".&Time2String(time() - $wingaterun)." ago";
        }
 
-       &performStrictReply("$reply.");
+       &pSReply("$reply.");
 
        return;
     }
@@ -776,7 +784,7 @@ sub DebianNew {
     }
     close IDX1;
 
-    &::performStrictReply( &::formListReply(0, "New debian packages:", @new) );
+    &::pSReply( &::formListReply(0, "New debian packages:", @new) );
 }
 
 sub do_verstats {
@@ -797,7 +805,7 @@ sub do_verstats {
        return;
     }
 
-    &msg($who, "Sending CTCP VERSION...");
+    &msg($who, "Sending CTCP VERSION to #$chan...");
     $conn->ctcp("VERSION", $chan);
     $cache{verstats}{chan}     = $chan;
     $cache{verstats}{who}      = $who;
@@ -806,6 +814,7 @@ sub do_verstats {
     $conn->schedule(30, sub {
        my $c           = lc $cache{verstats}{chan};
        @vernicktodo    = ();
+
        foreach (keys %{ $channels{$c}{''} } ) {
            next if (grep /^\Q$_\E$/i, @vernick);
            push(@vernicktodo, $_);