Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allowWithPermission not exist #16

Open
Gregory-Hepicloud opened this issue Feb 22, 2023 · 3 comments
Open

allowWithPermission not exist #16

Gregory-Hepicloud opened this issue Feb 22, 2023 · 3 comments

Comments

@Gregory-Hepicloud
Copy link

Hi we try to use your command handler working well but only : allowWithPermission not working

error :

The argument of type '{ name: string; description: string; commandType: "allGuild"; allowWithPermission: string[]; execute(command: CommandInteraction<CacheType>): Promise<void>; }' is not assignable to the 'SlashCommand' type parameter.
  An object literal can only characterize known properties, and 'allowWithPermission' does not exist in type 'RegularSlashCommand'.ts(2345)

exemple use :

export default defineSlashCommand({
    name: 'secret',
    description: 'Only for server moderators',
    // this command is registered in all the
    // guilds the bot is in
    commandType: 'allGuild',
    // this disables the command for anyone who
    // doesn't have any of these permissions
    allowWithPermission: ['MANAGE_SERVER'],
    async execute(command) {
        command.reply('Secret moderators stuff')
    }
});
@Gregory-Hepicloud
Copy link
Author

we see remove for port to discord v14 but who define default permision of command

@0xDevansh
Copy link
Owner

Yes, it has been removed because it was a very slow and inefficient way of handling command permissions.
Discord has now added permissions that you can set from the app itself, go to Server settings > Integrations > your bot name

@Gregory-Hepicloud
Copy link
Author

Hi thx you for your reponse did you know is possible to disable command for everyone for example to block a command ban everyone if don't change perm in discord default is set to everyone and can ban

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants