mirror of
https://github.com/pragma-/pbot.git
synced 2025-04-13 03:18:16 +02: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->{banlist} = {};
|
||||||
|
|
||||||
|
$self->{pbot}->{registry}->add_default('text', 'bantracker', 'chanserv_ban_timeout', '604800');
|
||||||
|
|
||||||
$pbot->{commands}->register(sub { return $self->dumpbans(@_) }, "dumpbans", 60);
|
$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(defined $target && $target eq $self->{pbot}->{registry}->get_value('irc', 'botnick')) { # bot targeted
|
||||||
if($mode eq "+o") {
|
if($mode eq "+o") {
|
||||||
$self->{pbot}->{logger}->log("$nick opped me in $channel\n");
|
$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);
|
$self->{pbot}->{chanops}->perform_op_commands($channel);
|
||||||
}
|
}
|
||||||
elsif($mode eq "-o") {
|
elsif($mode eq "-o") {
|
||||||
@ -159,7 +159,7 @@ sub on_mode {
|
|||||||
else { # bot not targeted
|
else { # bot not targeted
|
||||||
if($mode eq "+b") {
|
if($mode eq "+b") {
|
||||||
if($nick eq "ChanServ") {
|
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;
|
$self->{pbot}->{chanops}->{unban_timeout}->save;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -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 => 599,
|
BUILD_REVISION => 600,
|
||||||
BUILD_DATE => "2014-05-21",
|
BUILD_DATE => "2014-05-22",
|
||||||
};
|
};
|
||||||
|
|
||||||
1;
|
1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user