Skip to content
Extraits de code Groupes Projets
Valider b9c91945 rédigé par ElTata's avatar ElTata :ok_hand:
Parcourir les fichiers

help does not return admin command for non admi users anymore

parent b4d07c07
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -515,7 +515,7 @@ sub parse { ...@@ -515,7 +515,7 @@ sub parse {
$usernick); $usernick);
} }
} else { } 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 { } else {
# the message is not a command # the message is not a command
...@@ -528,9 +528,12 @@ sub help { ...@@ -528,9 +528,12 @@ sub help {
my ($userhost, $usernick, $username, $source, @arg) = @_; my ($userhost, $usernick, $username, $source, @arg) = @_;
my $ctxt = $source =~ m/^#/ ? 'pub' : 'prv'; my $ctxt = $source =~ m/^#/ ? 'pub' : 'prv';
my $ret = ''; my $ret = '';
my $isadmin = $rps->{username}{isadmin};
if (!exists($arg[0])) { if (!exists($arg[0])) {
$ret = "Available commands : ". $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. ". ". Do $opts->{token}help <cmds> for help on a specific command. ".
"For information on the game, see $opts->{helpurl}. "; "For information on the game, see $opts->{helpurl}. ";
} }
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter