mirror of
https://github.com/pragma-/pbot.git
synced 2025-05-03 13:17:33 +02:00
Plugins: Battleship, Connect4 and Spinach can now set their channel via registry
This commit is contained in:
parent
aac9230882
commit
aecdb08303
@ -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.quit', sub { $self->on_departure(@_) });
|
||||||
$self->{pbot}->{event_dispatcher}->register_handler('irc.kick', sub { $self->on_kick(@_) });
|
$self->{pbot}->{event_dispatcher}->register_handler('irc.kick', sub { $self->on_kick(@_) });
|
||||||
|
|
||||||
$self->{channel} = '##battleship';
|
$self->{channel} = $self->{pbot}->{registry}->get_value('battleship', 'channel') // '##battleship';
|
||||||
$self->{debug} = 0;
|
$self->{debug} = $self->{pbot}->{registry}->get_value('battleship', 'debug') // 0;
|
||||||
$self->create_states;
|
$self->create_states;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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.quit', sub { $self->on_departure(@_) });
|
||||||
$self->{pbot}->{event_dispatcher}->register_handler('irc.kick', sub { $self->on_kick(@_) });
|
$self->{pbot}->{event_dispatcher}->register_handler('irc.kick', sub { $self->on_kick(@_) });
|
||||||
|
|
||||||
$self->{debug} = 0;
|
$self->{channel} = $self->{pbot}->{registry}->get_value('connect4', 'channel') // '##connect4';
|
||||||
$self->{channel} = '##connect4';
|
$self->{debug} = $self->{pbot}->{registry}->get_value('connect4', 'debug') // 0;
|
||||||
$self->create_states;
|
$self->create_states;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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.quit', sub { $self->on_departure(@_) });
|
||||||
$self->{pbot}->{event_dispatcher}->register_handler('irc.kick', sub { $self->on_kick(@_) });
|
$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';
|
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";
|
$self->{questions_filename} = $self->{pbot}->{registry}->get_value('general', 'data_dir') . "/spinach/$default_file";
|
||||||
@ -257,7 +257,7 @@ sub spinach_cmd {
|
|||||||
|
|
||||||
my $command;
|
my $command;
|
||||||
($command, $arguments) = split / /, $arguments, 2;
|
($command, $arguments) = split / /, $arguments, 2;
|
||||||
$command = lc $command;
|
$command = defined $command ? lc $command : '';
|
||||||
|
|
||||||
my ($channel, $result);
|
my ($channel, $result);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user