Plugins: Battleship, Connect4 and Spinach can now set their channel via registry

This commit is contained in:
Pragmatic Software 2020-01-21 20:15:14 -08:00
parent aac9230882
commit aecdb08303
3 changed files with 6 additions and 6 deletions

View File

@ -38,8 +38,8 @@ sub initialize {
$self->{pbot}->{event_dispatcher}->register_handler('irc.quit', sub { $self->on_departure(@_) });
$self->{pbot}->{event_dispatcher}->register_handler('irc.kick', sub { $self->on_kick(@_) });
$self->{channel} = '##battleship';
$self->{debug} = 0;
$self->{channel} = $self->{pbot}->{registry}->get_value('battleship', 'channel') // '##battleship';
$self->{debug} = $self->{pbot}->{registry}->get_value('battleship', 'debug') // 0;
$self->create_states;
}

View File

@ -39,8 +39,8 @@ sub initialize {
$self->{pbot}->{event_dispatcher}->register_handler('irc.quit', sub { $self->on_departure(@_) });
$self->{pbot}->{event_dispatcher}->register_handler('irc.kick', sub { $self->on_kick(@_) });
$self->{debug} = 0;
$self->{channel} = '##connect4';
$self->{channel} = $self->{pbot}->{registry}->get_value('connect4', 'channel') // '##connect4';
$self->{debug} = $self->{pbot}->{registry}->get_value('connect4', 'debug') // 0;
$self->create_states;
}

View File

@ -58,7 +58,7 @@ sub initialize {
$self->{pbot}->{event_dispatcher}->register_handler('irc.quit', sub { $self->on_departure(@_) });
$self->{pbot}->{event_dispatcher}->register_handler('irc.kick', sub { $self->on_kick(@_) });
$self->{channel} = '##spinach';
$self->{channel} = $self->{pbot}->{registry}->get_value('spinach', 'channel') // '##spinach';
my $default_file = $self->{pbot}->{registry}->get_value('spinach', 'file') // 'trivia.json';
$self->{questions_filename} = $self->{pbot}->{registry}->get_value('general', 'data_dir') . "/spinach/$default_file";
@ -257,7 +257,7 @@ sub spinach_cmd {
my $command;
($command, $arguments) = split / /, $arguments, 2;
$command = lc $command;
$command = defined $command ? lc $command : '';
my ($channel, $result);