From c36f9d72bb951ad4415f44844f8fe3a069639227 Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Sat, 25 Jan 2020 16:09:43 -0800 Subject: [PATCH] Users: `my` command: add level sanity check --- PBot/Users.pm | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/PBot/Users.pm b/PBot/Users.pm index a2a9f686..54056ad2 100644 --- a/PBot/Users.pm +++ b/PBot/Users.pm @@ -452,6 +452,10 @@ sub mycmd { } } + if ($key eq 'level' and defined $value and $u->{level} < 90 and $value > $u->{level}) { + return "You may not increase your level!"; + } + ($channel, $hostmask) = $self->find_user_account($channel, $hostmask); my $result = $self->{users}->set($channel, $hostmask, $key, $value); $result =~ s/^password => .*;?$/password => ;/m;