Skip to content

Instantly share code, notes, and snippets.

@andrewgazelka
Last active January 29, 2019 21:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewgazelka/f5721f9bbb36827cae19224eeb426d4d to your computer and use it in GitHub Desktop.
Save andrewgazelka/f5721f9bbb36827cae19224eeb426d4d to your computer and use it in GitHub Desktop.
cmd("permissions", "perms") {
description = "manage permissions"
permission = has("simplepermissions.use")
subCmd("group", "g") {
description = "manage groups"
arg("group") {
description = "the group you want to add"
ifType(ArgumentGroup) {
description = "an existing group"
subCmd("perms", "p") {
execute { sender, node, args ->
val group: Group by args
sender.sendMessage("perms enabled: ${group.permissionsEnabled}")
sender.sendMessage("perms disabled: ${group.permissionsDisabled}")
}
}
}
ifType(ArgumentString) {
description = "a non-existing group"
subCmd("create", "c") {
arg("priority") {
ifType(ArgumentInt) {
execute { sender, node, args ->
val group: String by args
val priority: Int by args
sender.sendMessage("group: $group")
sender.sendMessage("priority: $priority")
}
}
}
}
}
}
}
subCmd("player", "p") {
description = "manage players"
}
}.register(plugin)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment