mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-26 22:09:26 +01:00
Add registry entry for ChanServ ban timeout
This commit is contained in:
parent
5904a3f1f4
commit
c2089562c5
@ -36,6 +36,8 @@ sub initialize {
|
||||
|
||||
$self->{banlist} = {};
|
||||
|
||||
$self->{pbot}->{registry}->add_default('text', 'bantracker', 'chanserv_ban_timeout', '604800');
|
||||
|
||||
$pbot->{commands}->register(sub { return $self->dumpbans(@_) }, "dumpbans", 60);
|
||||
}
|
||||
|
||||
|
@ -144,7 +144,7 @@ sub on_mode {
|
||||
if(defined $target && $target eq $self->{pbot}->{registry}->get_value('irc', 'botnick')) { # bot targeted
|
||||
if($mode eq "+o") {
|
||||
$self->{pbot}->{logger}->log("$nick opped me in $channel\n");
|
||||
$self->{pbot}->{chanops}->{is_opped}->{$channel}{timeout} = gettimeofday + 300; # 5 minutes
|
||||
$self->{pbot}->{chanops}->{is_opped}->{$channel}{timeout} = gettimeofday + $self->{pbot}->{registry}->get_value('general', 'deop_timeout');;
|
||||
$self->{pbot}->{chanops}->perform_op_commands($channel);
|
||||
}
|
||||
elsif($mode eq "-o") {
|
||||
@ -159,7 +159,7 @@ sub on_mode {
|
||||
else { # bot not targeted
|
||||
if($mode eq "+b") {
|
||||
if($nick eq "ChanServ") {
|
||||
$self->{pbot}->{chanops}->{unban_timeout}->hash->{$channel}->{$target}{timeout} = gettimeofday + 3600 * 2; # 2 hours
|
||||
$self->{pbot}->{chanops}->{unban_timeout}->hash->{$channel}->{$target}{timeout} = gettimeofday + $self->{pbot}->{registry}->get_value('bantracker', 'chanserv_ban_timeout');
|
||||
$self->{pbot}->{chanops}->{unban_timeout}->save;
|
||||
}
|
||||
}
|
||||
|
@ -13,8 +13,8 @@ use warnings;
|
||||
# These are set automatically by the build/commit script
|
||||
use constant {
|
||||
BUILD_NAME => "PBot",
|
||||
BUILD_REVISION => 599,
|
||||
BUILD_DATE => "2014-05-21",
|
||||
BUILD_REVISION => 600,
|
||||
BUILD_DATE => "2014-05-22",
|
||||
};
|
||||
|
||||
1;
|
||||
|
Loading…
Reference in New Issue
Block a user