mirror of
https://github.com/pragma-/pbot.git
synced 2025-01-11 12:32:37 +01:00
Plugins: add capabilities to default groups
This commit is contained in:
parent
97a913ef32
commit
c058c42b1c
@ -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 {
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user