Skip to content

Discord permissions do not apply? #91

Description

@skyeredwood

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)
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions