mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-20 02:49:49 +01:00
Only admins can add counter triggers
This commit is contained in:
parent
8792633b6a
commit
1339b30c4b
@ -30,7 +30,7 @@ sub initialize {
|
||||
$self->{pbot}->{commands}->register(sub { $self->counterreset(@_) }, 'counterreset', 0);
|
||||
$self->{pbot}->{commands}->register(sub { $self->countershow(@_) }, 'countershow', 0);
|
||||
$self->{pbot}->{commands}->register(sub { $self->counterlist(@_) }, 'counterlist', 0);
|
||||
$self->{pbot}->{commands}->register(sub { $self->countertrigger(@_) }, 'countertrigger', 0);
|
||||
$self->{pbot}->{commands}->register(sub { $self->countertrigger(@_) }, 'countertrigger', 10);
|
||||
|
||||
$self->{pbot}->{event_dispatcher}->register_handler('irc.public', sub { $self->on_public(@_) });
|
||||
|
||||
@ -377,7 +377,7 @@ sub counterreset {
|
||||
my ($description, $timestamp) = $self->reset_counter($channel, $name);
|
||||
if (defined $description) {
|
||||
my $ago = duration gettimeofday - $timestamp;
|
||||
$result = "It had been $ago since $description. Not any more.";
|
||||
$result = "It had been $ago since $description.";
|
||||
} else {
|
||||
$result = "No such counter.";
|
||||
}
|
||||
@ -596,7 +596,7 @@ sub on_public {
|
||||
if (defined $desc) {
|
||||
if (gettimeofday - $timestamp >= 60 * 60) {
|
||||
my $ago = duration gettimeofday - $timestamp;
|
||||
$event->{conn}->privmsg($channel, "It had been $ago since $desc. Not any more.");
|
||||
$event->{conn}->privmsg($channel, "It had been $ago since $desc.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user