do not use the same arguments as nonce and perm level

This commit is contained in:
NikkyAI 2018-11-28 15:23:47 +01:00
parent fe9cb31d72
commit 05ed3b4a9b
1 changed files with 3 additions and 3 deletions

View File

@ -45,10 +45,10 @@ object CommandCoreML {
return "no code passed" return "no code passed"
} }
if (request.nonce != nonce) { if (request.nonce != nonce) {
return "nonce in request does not match" return "nonce in request does not match with $nonce"
} }
val powerLevelArg = args.getOrNull(2)?.toDoubleOrNull() val powerLevelArg = args.getOrNull(3)?.toDoubleOrNull()
val powerLevel = powerLevelArg ?: run { return "permLevel cannot be parsed (args: $args)" } val powerLevel = powerLevelArg ?: run { return "permLevel cannot be parsed: ${args.getOrNull(3)}" }
?: request.powerlevel ?: request.powerlevel
?: return "no permLevel provided" ?: return "no permLevel provided"
PermissionConfig.add(request.uuid, powerLevel, "${request.user} Authorized by $user") PermissionConfig.add(request.uuid, powerLevel, "${request.user} Authorized by $user")