# process the incoming message
#
-#use strict;
+use strict;
+
+use vars qw($who $msgType $addressed $message $ident $user $host $chan
+ $learnok $talkok $force_public_reply $noreply $addrchar
+ $literal $addressedother $userHandle $lobotomized);
+use vars qw(%channels %users %param %cache %chanconf %mask %orig %lang
+ );
sub process {
$learnok = 0; # Able to learn?
# karma. set...
if ($message =~ /^(\S+)(--|\+\+)\s*$/ and $addressed) {
return '' unless (&hasParam("karma"));
+ # well... since it is policy to do bot functions before factoids
+ # karma gets hit if, for example, "g++" is issued.
+ # only way to request it is to put a question mark at the end.
my($term,$inc) = (lc $1,$2);
return;
}
- my $karma = &dbGet("stats", "counter", "nick=".&dbQuote($term).
- " AND type='karma'") || 0;
+ my $karma = &sqlSelect("stats", "counter",
+ { nick => $term, type => "karma" }) || 0;
if ($inc eq '++') {
$karma++;
} else {
$karma--;
}
- &dbSet("stats",
- { nick => $term, type => "karma" },
- { counter => $karma }
- );
+ &sqlReplace("stats", {
+ nick => $term,
+ type => "karma",
+ 'time' => time(),
+ counter => $karma,
+ } );
return;
}
return 'SOMETHING 1';
}
+ # allow administration of bot via messages (default is DCC CHAT only)
+ if (&IsFlag("A")) {
+ &loadMyModule( $myModules{'ircdcc'} );
+ $er = &userDCC();
+ if (!defined $er) {
+ return 'SOMETHING 2';
+ }
+ }
+
if (0 and $addrchar) {
&msg($who, "I don't trust people to use the core commands while addressing me in a short-cut way.");
return;
}
}
- if (&IsParam("factoids") and $param{'DBType'} =~ /^(mysql|sqlite|pgsql|dbm)/i) {
+ if (&IsParam("factoids") and $param{'DBType'} =~ /^(mysql|sqlite|pgsql)/i) {
&FactoidStuff();
} elsif ($param{'DBType'} =~ /^none$/i) {
return "NO FACTOIDS.";