Skip to content

Commit

Permalink
feat: 🎸 selenechatのサブコマンドに権限を割り当てた
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueSheep2804 committed Jul 21, 2023
1 parent e7a60c7 commit e318061
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ class SeleneChatCommand : ICommand {
return false
}
if (args[0] == "reload") {
if (!sender.hasPermission("selenechat.command.selenechat.reload")) {
sender.sendMessage(SeleneChat.resource.command.selenechatErrorSubCommandPermission)
return false
}
SeleneChat.configManager.reload()
SeleneChat.resourceManager.reload()
SeleneChat.japanizePlayersManager.reload()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ data class CommandResourceData(
@Serializable(with = ComponentSerializer::class)
val selenechatErrorSubCommandEmpty: Component = Component.text("Argument is missing.", NamedTextColor.RED),
@Serializable(with = ComponentSerializer::class)
val selenechatErrorSubCommandPermission: Component = Component.text("You do not have permission to execute that command.", NamedTextColor.RED),
@Serializable(with = ComponentSerializer::class)
val selenechatSuccessReload: Component = Component.text("Reloaded!"),
@Serializable(with = ComponentSerializer::class)
val japanizeErrorUnexpectedArgs: Component = Component.text("The argument must be one of [on, off].", NamedTextColor.RED),
Expand Down
3 changes: 3 additions & 0 deletions src/main/resources/plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ permissions:
selenechat.command.selenechat:
description: Allow the use of SeleneChat commands
default: op
selenechat.command.selenechat.reload:
description: Allow use of SeleneChat reload command
default: op
selenechat.command.message:
description: Allow use of SeleneChat message command
default: true
Expand Down

0 comments on commit e318061

Please sign in to comment.