Fix help usage. Upgrade to enhanced switch
This commit is contained in:
parent
18be26d5ca
commit
fa42c698a4
@ -18,7 +18,7 @@ import java.util.List;
|
|||||||
public class PermissionCommand extends Command {
|
public class PermissionCommand extends Command {
|
||||||
@Override public String name() { return "Permission"; }
|
@Override public String name() { return "Permission"; }
|
||||||
@Override public String description() { return "Manages a user's static permissions"; }
|
@Override public String description() { return "Manages a user's static permissions"; }
|
||||||
@Override public String usage() { return "permission <list|add|remove> <keyword>"; }
|
@Override public String usage() { return "permission <list|add|remove> <@usermention> <keyword>"; }
|
||||||
@Override public CommandCategory category() { return CommandCategory.DEVELOPER; }
|
@Override public CommandCategory category() { return CommandCategory.DEVELOPER; }
|
||||||
@Override public CommandPermission permission() { return new CommandPermission(PermissionType.OWNER); }
|
@Override public CommandPermission permission() { return new CommandPermission(PermissionType.OWNER); }
|
||||||
@Override public List<String> aliases() { return Arrays.asList("permission", "permissions", "perm", "perms"); }
|
@Override public List<String> aliases() { return Arrays.asList("permission", "permissions", "perm", "perms"); }
|
||||||
@ -27,21 +27,19 @@ public class PermissionCommand extends Command {
|
|||||||
public void onCommand(CommandContext ctx) {
|
public void onCommand(CommandContext ctx) {
|
||||||
String[] args = ctx.getArgs();
|
String[] args = ctx.getArgs();
|
||||||
|
|
||||||
switch(args[0]) {
|
switch (args[0]) {
|
||||||
case "list":
|
case "list" ->
|
||||||
// List all the static permissions
|
// List all the static permissions
|
||||||
list(ctx);
|
list(ctx);
|
||||||
break;
|
case "add" ->
|
||||||
case "add":
|
|
||||||
// Add a static permission to the mentioned user, if any
|
// Add a static permission to the mentioned user, if any
|
||||||
add(ctx);
|
add(ctx);
|
||||||
break;
|
case "remove" ->
|
||||||
case "remove":
|
|
||||||
// Remove a static permission from the mentioned user, if any
|
// Remove a static permission from the mentioned user, if any
|
||||||
remove(ctx);
|
remove(ctx);
|
||||||
break;
|
default -> {
|
||||||
default:
|
}
|
||||||
// You don't know how to use this command LUL
|
// You don't know how to use this command LUL
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user