diff --git a/Plugins/ActionTrigger.pm b/Plugins/ActionTrigger.pm index f3ec3b25..86ea37cc 100644 --- a/Plugins/ActionTrigger.pm +++ b/Plugins/ActionTrigger.pm @@ -51,7 +51,8 @@ sub initialize { my ($self, %conf) = @_; $self->{pbot} = delete $conf{pbot} // Carp::croak("Missing pbot reference to " . __FILE__); - $self->{pbot}->{commands}->register(sub { $self->actiontrigger(@_) }, 'actiontrigger', 10); + $self->{pbot}->{commands}->register(sub { $self->actiontrigger(@_) }, 'actiontrigger', 1); + $self->{pbot}->{capabilities}->add('admin', 'can-actiontrigger', 1); $self->{pbot}->{event_dispatcher}->register_handler('irc.public', sub { $self->on_public(@_) }); $self->{pbot}->{event_dispatcher}->register_handler('irc.caction', sub { $self->on_action(@_) }); @@ -70,6 +71,7 @@ sub unload { my $self = shift; $self->dbi_end; $self->{pbot}->{commands}->unregister('actiontrigger'); + $self->{pbot}->{capabilities}->remove('can-actiontrigger'); } sub create_database { diff --git a/Plugins/Counter.pm b/Plugins/Counter.pm index 79b0c00e..2cbe7c51 100644 --- a/Plugins/Counter.pm +++ b/Plugins/Counter.pm @@ -34,7 +34,8 @@ 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', 10); + $self->{pbot}->{commands}->register(sub { $self->countertrigger(@_) }, 'countertrigger', 1); + $self->{pbot}->{capabilities}->add('admin', 'can-countertrigger', 1); $self->{pbot}->{event_dispatcher}->register_handler('irc.public', sub { $self->on_public(@_) }); @@ -44,13 +45,13 @@ sub initialize { sub unload { my $self = shift; - $self->{pbot}->{commands}->unregister('counteradd'); $self->{pbot}->{commands}->unregister('counterdel'); $self->{pbot}->{commands}->unregister('counterreset'); $self->{pbot}->{commands}->unregister('countershow'); $self->{pbot}->{commands}->unregister('counterlist'); $self->{pbot}->{commands}->unregister('countertrigger'); + $self->{pbot}->{capabilities}->remove('can-countertrigger'); } sub create_database {