mirror of
https://github.com/pragma-/pbot.git
synced 2024-11-23 12:29:27 +01:00
Factoids: test enabled for definedness
This commit is contained in:
parent
a40b443c66
commit
ef072602fa
@ -1284,7 +1284,9 @@ sub handle_action {
|
|||||||
$self->{pbot}->{logger}
|
$self->{pbot}->{logger}
|
||||||
->log("(" . (defined $context->{from} ? $context->{from} : "(undef)") . "): $context->{nick}!$context->{user}\@$context->{host}: $trigger_name: action: \"$action\"\n");
|
->log("(" . (defined $context->{from} ? $context->{from} : "(undef)") . "): $context->{nick}!$context->{user}\@$context->{host}: $trigger_name: action: \"$action\"\n");
|
||||||
|
|
||||||
if ($self->{factoids}->get_data($channel, $keyword, 'enabled') == 0) {
|
my $enabled = $self->{factoids}->get_data($channel, $keyword, 'enabled');
|
||||||
|
|
||||||
|
if (defined $enabled and $enabled == 0) {
|
||||||
$self->{pbot}->{logger}->log("$trigger_name disabled.\n");
|
$self->{pbot}->{logger}->log("$trigger_name disabled.\n");
|
||||||
return "/msg $context->{nick} ${ref_from}$trigger_name is currently disabled.";
|
return "/msg $context->{nick} ${ref_from}$trigger_name is currently disabled.";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user