From b9c9194516bb5bc75881db990d20b9860e8fa4a9 Mon Sep 17 00:00:00 2001 From: ElTata <eltata@firemail.cc> Date: Fri, 4 Oct 2019 21:04:46 +0200 Subject: [PATCH] help does not return admin command for non admi users anymore --- Irpg/Main.pm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Irpg/Main.pm b/Irpg/Main.pm index 1454e74..a63daa2 100644 --- a/Irpg/Main.pm +++ b/Irpg/Main.pm @@ -515,7 +515,7 @@ sub parse { $usernick); } } else { - Irpg::Irc::privmsg("You don't have access to ".uc($arg[3]).".", $usernick); + Irpg::Irc::notice("You don't have access to ".uc($arg[3]).".", $usernick); } } else { # the message is not a command @@ -528,9 +528,12 @@ sub help { my ($userhost, $usernick, $username, $source, @arg) = @_; my $ctxt = $source =~ m/^#/ ? 'pub' : 'prv'; my $ret = ''; + my $isadmin = $rps->{username}{isadmin}; if (!exists($arg[0])) { $ret = "Available commands : ". - join(', ', grep({ $commands{$_}->{$ctxt} } keys(%commands))). + join(', ', grep({ $commands{$_}->{$ctxt} + && $commands{$_}->{adm} <= $isadmin + } keys(%commands))). ". Do $opts->{token}help <cmds> for help on a specific command. ". "For information on the game, see $opts->{helpurl}. "; } -- GitLab