From 6f282d2968d09ca7df43aeb4f261d9af137b76a7 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Mon, 27 May 2019 19:40:24 -0700 Subject: [PATCH] factset: respect `locked` metadata --- PBot/FactoidCommands.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/PBot/FactoidCommands.pm b/PBot/FactoidCommands.pm index a816d633..7ad20350 100644 --- a/PBot/FactoidCommands.pm +++ b/PBot/FactoidCommands.pm @@ -555,6 +555,10 @@ sub factset { } } + if (defined $value and !$level and $self->{pbot}->{factoids}->{factoids}->hash->{$channel}->{$trigger}->{'locked'}) { + return "/say $trigger is locked; unlock before setting."; + } + if (lc $key eq 'effective-level' and defined $value and $level > 0) { if ($value > $level) { return "You cannot set `effective-level` greater than your level, which is $level.";