From 14941497a11cefea9af78953475789b1b0918108 Mon Sep 17 00:00:00 2001 From: timriker Date: Wed, 2 Mar 2005 06:00:16 +0000 Subject: [PATCH] CMD: is now cmd:, commands in sqlite will be broken! git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@1208 c11ca15a-4712-0410-83d8-924469b57eb5 --- ChangeLog | 5 +++++ src/CommandStubs.pl | 2 +- src/Factoids/Core.pl | 2 -- src/Factoids/Question.pl | 6 +++--- src/Factoids/Reply.pl | 3 +-- src/Factoids/Statement.pl | 2 +- src/Factoids/Update.pl | 2 +- src/IRC/Schedulers.pl | 2 +- src/Modules/Factoids.pl | 1 - src/Modules/Topic.pl | 2 +- 10 files changed, 14 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index ffe70a6..baed181 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ + +2005-02-18 00:00 timriker + + * CMD: is now cmd: + 2005-02-18 00:00 timriker * src/Factoids/Question.pl: minVolunteerLength now per channel diff --git a/src/CommandStubs.pl b/src/CommandStubs.pl index 6387971..1beb9e0 100644 --- a/src/CommandStubs.pl +++ b/src/CommandStubs.pl @@ -904,6 +904,6 @@ sub nullski { ### END OF ADDING HOOKS. ### -&status('CMD: loaded '.scalar(keys %cmdhooks).' command hooks.'); +&status('loaded '.scalar(keys %cmdhooks).' command hooks.'); 1; diff --git a/src/Factoids/Core.pl b/src/Factoids/Core.pl index 684922d..c3fb474 100644 --- a/src/Factoids/Core.pl +++ b/src/Factoids/Core.pl @@ -146,7 +146,6 @@ sub FactoidStuff { } $faqtoid =~ tr/A-Z/a-z/; - $faqtoid =~ s/^cmd:/CMD:/; # basic command forgetting my $result = &getFactoid($faqtoid); # if it doesn't exist, well... it doesn't! @@ -306,7 +305,6 @@ sub FactoidStuff { } $faqtoid =~ tr/A-Z/a-z/; - $faqtoid =~ s/^cmd:/CMD:/; # basic command undeleteing my $result = &getFactoid($faqtoid." #DEL#"); my $check = &getFactoid($faqtoid); diff --git a/src/Factoids/Question.pl b/src/Factoids/Question.pl index b9dfd80..0b7ae04 100644 --- a/src/Factoids/Question.pl +++ b/src/Factoids/Question.pl @@ -188,7 +188,7 @@ sub factoidArgs { # TODO: cache this, update cache when altered. !!! !!! !!! # my $t = &timeget(); my ($first) = split(/\s+/, $str); - my @list = &searchTable("factoids", "factoid_key", "factoid_key", "^CMD: $first "); + my @list = &searchTable("factoids", "factoid_key", "factoid_key", "^cmd: $first "); # my $delta_time = &timedelta($t); # &DEBUG("factArgs: delta_time = $delta_time s"); # &DEBUG("factArgs: list => ".scalar(@list) ); @@ -200,7 +200,7 @@ sub factoidArgs { foreach (sort { length($b) <=> length($a) } @list) { next if (/#DEL#/); # deleted. - s/^CMD: //i; + s/^cmd: //i; # &DEBUG("factarg: '$str' =~ /^$_\$/"); my $arg = $_; @@ -230,7 +230,7 @@ sub factoidArgs { &status("Question: factoid Arguments for '$str'"); # TODO: use getReply() - need to modify it :( my $i = 0; - my $q = "CMD: $_"; + my $q = "cmd: $_"; my $r = &getFactoid($q); if (!defined $r) { &DEBUG("question: !result... should this happen?"); diff --git a/src/Factoids/Reply.pl b/src/Factoids/Reply.pl index b06347d..8c72ac1 100644 --- a/src/Factoids/Reply.pl +++ b/src/Factoids/Reply.pl @@ -27,7 +27,6 @@ sub getReply { } $message =~ tr/A-Z/a-z/; - $message =~ s/^cmd:/CMD:/; @searches = split(/\s+/, &getChanConfDefault('factoidSearch', '_default')); @@ -150,7 +149,7 @@ sub getReply { ### # don't evaluate if it has factoid arguments. - if ($message =~ /^CMD:/i) { + if ($message =~ /^cmd:/i) { &status("Reply: not doing substVars (eval dollar vars)"); } else { $reply = &substVars($reply,1); diff --git a/src/Factoids/Statement.pl b/src/Factoids/Statement.pl index d2c29fe..6617dd6 100644 --- a/src/Factoids/Statement.pl +++ b/src/Factoids/Statement.pl @@ -56,7 +56,7 @@ sub doStatement { my($lhs, $mhs, $rhs) = ($`, $&, $'); # allows factoid arguments to be updated. -lear. - $lhs =~ s/^(CMD: )?(.*)/$1||"" . lc $2/e; + $lhs =~ s/^(cmd: )?(.*)/$1||"" . lc $2/e; # discard article. $lhs =~ s/^(the|da|an?)\s+//i; diff --git a/src/Factoids/Update.pl b/src/Factoids/Update.pl index 2a02b24..915eec1 100644 --- a/src/Factoids/Update.pl +++ b/src/Factoids/Update.pl @@ -61,7 +61,7 @@ sub update { my @list; my $count = 0; - $lhs =~ s/^/CMD: /; + $lhs =~ s/^/cmd: /; while ($lhs =~ s/\$(\S+)/(.*?)/) { push(@list, "\$$1"); $count++; diff --git a/src/IRC/Schedulers.pl b/src/IRC/Schedulers.pl index 04f9060..963cad6 100644 --- a/src/IRC/Schedulers.pl +++ b/src/IRC/Schedulers.pl @@ -165,7 +165,7 @@ sub randomFactoid { ($key,$val) = &randKey("factoids","factoid_key,factoid_value"); &DEBUG("rF: $key, $val"); ### $val =~ tr/^[A-Z]/[a-z]/; # blah is Good => blah is good. - last if ((defined $val) and ($val !~ /^