diff --git a/Plugins/Battleship.pm b/Plugins/Battleship.pm index 5e5e7013..87c2054b 100644 --- a/Plugins/Battleship.pm +++ b/Plugins/Battleship.pm @@ -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; } diff --git a/Plugins/Connect4.pm b/Plugins/Connect4.pm index a822db14..658ec6bd 100644 --- a/Plugins/Connect4.pm +++ b/Plugins/Connect4.pm @@ -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; } diff --git a/Plugins/Spinach.pm b/Plugins/Spinach.pm index da072bc7..40054ce9 100644 --- a/Plugins/Spinach.pm +++ b/Plugins/Spinach.pm @@ -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);