I'm unable to lock a command behind certain Discord permissions. I've tried multiple forms of the statement, but every time the commands are usable by everyone.
fun create(manager: JDA5CommandManager<JDAInteraction>, plugin: myPlugin) {
this.manager = manager
this.plugin = plugin
val whitelistRoot = manager.commandBuilder("whitelist", Description.of("Whitelist controls"))
val whitelistAllCommand = whitelistRoot.literal("all", Description.of("Whitelist all users in this Discord server"))
.apply(ReplySetting.defer(true))
.apply(CommandScope.guilds())
.required(manager.componentBuilder(String::class.java, "server").suggestionProvider(suggestServers()))
// also tried DiscordPermission.of(Permission.ADMINISTRATOR.name)) and DiscordPermission.of(Permission.ADMINISTRATOR.rawValue))
.permission(DiscordPermission.of(0x8))
.handler {
whitelistAll(it.sender(), it.get("server"))
}
manager.command(whitelistAllCommand)
}
I'm unable to lock a command behind certain Discord permissions. I've tried multiple forms of the statement, but every time the commands are usable by everyone.