3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-12-23 19:22:40 +01:00

Factoids: test enabled for definedness

This commit is contained in:
Pragmatic Software 2020-06-07 00:12:09 -07:00
parent a40b443c66
commit ef072602fa

View File

@ -1284,7 +1284,9 @@ sub handle_action {
$self->{pbot}->{logger}
->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");
return "/msg $context->{nick} ${ref_from}$trigger_name is currently disabled.";
}