mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-20 02:49:49 +01:00
Bot now keeps message history for itself -- can now be grabbed for quotegrabs
This commit is contained in:
parent
111847340e
commit
1155205f0e
@ -218,8 +218,6 @@ sub check_flood {
|
|||||||
$user = lc $user;
|
$user = lc $user;
|
||||||
$host = lc $host;
|
$host = lc $host;
|
||||||
|
|
||||||
return if $nick eq lc $self->{pbot}->botnick;
|
|
||||||
|
|
||||||
my $account = $self->get_flood_account($nick, $user, $host);
|
my $account = $self->get_flood_account($nick, $user, $host);
|
||||||
|
|
||||||
if(not defined $account) {
|
if(not defined $account) {
|
||||||
@ -268,6 +266,9 @@ sub check_flood {
|
|||||||
my $length = $self->add_message($account, $channel, $text, $mode);
|
my $length = $self->add_message($account, $channel, $text, $mode);
|
||||||
return if not defined $length;
|
return if not defined $length;
|
||||||
|
|
||||||
|
# do not do flood processing for bot messages
|
||||||
|
return if $nick eq lc $self->{pbot}->botnick;
|
||||||
|
|
||||||
# do not do flood processing if channel is not in bot's channel list or bot is not set as chanop for the channel
|
# do not do flood processing if channel is not in bot's channel list or bot is not set as chanop for the channel
|
||||||
return if ($channel =~ /^#/) and (not exists $self->{pbot}->channels->channels->hash->{$channel} or $self->{pbot}->channels->channels->hash->{$channel}{chanop} == 0);
|
return if ($channel =~ /^#/) and (not exists $self->{pbot}->channels->channels->hash->{$channel} or $self->{pbot}->channels->channels->hash->{$channel}{chanop} == 0);
|
||||||
|
|
||||||
|
@ -170,8 +170,10 @@ sub process_line {
|
|||||||
|
|
||||||
if($result =~ s/^\/say\s+//i) {
|
if($result =~ s/^\/say\s+//i) {
|
||||||
$pbot->conn->privmsg($from, $result) if defined $from && $from !~ /\Q$mynick\E/i;
|
$pbot->conn->privmsg($from, $result) if defined $from && $from !~ /\Q$mynick\E/i;
|
||||||
|
$pbot->antiflood->check_flood($from, $pbot->{botnick}, $pbot->{username}, 'localhost', $result, 0, 0, 0);
|
||||||
} elsif($result =~ s/^\/me\s+//i) {
|
} elsif($result =~ s/^\/me\s+//i) {
|
||||||
$pbot->conn->me($from, $result) if defined $from && $from !~ /\Q$mynick\E/i;
|
$pbot->conn->me($from, $result) if defined $from && $from !~ /\Q$mynick\E/i;
|
||||||
|
$pbot->antiflood->check_flood($from, $pbot->{botnick}, $pbot->{username}, 'localhost', '/me ' . $result, 0, 0, 0);
|
||||||
} elsif($result =~ s/^\/msg\s+([^\s]+)\s+//i) {
|
} elsif($result =~ s/^\/msg\s+([^\s]+)\s+//i) {
|
||||||
my $to = $1;
|
my $to = $1;
|
||||||
if($to =~ /,/) {
|
if($to =~ /,/) {
|
||||||
@ -182,14 +184,18 @@ sub process_line {
|
|||||||
}
|
}
|
||||||
elsif($result =~ s/^\/me\s+//i) {
|
elsif($result =~ s/^\/me\s+//i) {
|
||||||
$pbot->conn->me($to, $result) if $to !~ /\Q$mynick\E/i;
|
$pbot->conn->me($to, $result) if $to !~ /\Q$mynick\E/i;
|
||||||
|
$pbot->antiflood->check_flood($to, $pbot->{botnick}, $pbot->{username}, 'localhost', '/me ' . $result, 0, 0, 0);
|
||||||
} else {
|
} else {
|
||||||
$result =~ s/^\/say\s+//i;
|
$result =~ s/^\/say\s+//i;
|
||||||
$pbot->conn->privmsg($to, $result) if $to !~ /\Q$mynick\E/i;
|
$pbot->conn->privmsg($to, $result) if $to !~ /\Q$mynick\E/i;
|
||||||
|
$pbot->antiflood->check_flood($to, $pbot->{botnick}, $pbot->{username}, 'localhost', $result, 0, 0, 0);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$pbot->conn->privmsg($from, $result) if defined $from && $from !~ /\Q$mynick\E/i;
|
$pbot->conn->privmsg($from, $result) if defined $from && $from !~ /\Q$mynick\E/i;
|
||||||
|
$pbot->antiflood->check_flood($from, $pbot->{botnick}, $pbot->{username}, 'localhost', $result, 0, 0, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$pbot->logger->log("---------------------------------------------\n");
|
$pbot->logger->log("---------------------------------------------\n");
|
||||||
|
|
||||||
# TODO: move this to FactoidModuleLauncher somehow, completely out of Interpreter!
|
# TODO: move this to FactoidModuleLauncher somehow, completely out of Interpreter!
|
||||||
|
@ -13,8 +13,8 @@ use warnings;
|
|||||||
# These are set automatically by the build/commit script
|
# These are set automatically by the build/commit script
|
||||||
use constant {
|
use constant {
|
||||||
BUILD_NAME => "PBot",
|
BUILD_NAME => "PBot",
|
||||||
BUILD_REVISION => 455,
|
BUILD_REVISION => 456,
|
||||||
BUILD_DATE => "2013-10-19",
|
BUILD_DATE => "2013-10-22",
|
||||||
};
|
};
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
Loading…
Reference in New Issue
Block a user