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

Support default_permission for DiscordCommand #53

Closed
EthanC opened this issue Aug 4, 2021 · 3 comments · Fixed by #47
Closed

Support default_permission for DiscordCommand #53

EthanC opened this issue Aug 4, 2021 · 3 comments · Fixed by #47
Labels
Endpoint Updates Fixed in the Next Release This issue will be resolved in the next release.

Comments

@EthanC
Copy link

EthanC commented Aug 4, 2021

You can also set a default_permission on your commands if you want them to be disabled by default when your app is added to a new guild. Setting default_permission to false will disallow anyone in a guild from using the command--even Administrators and guild owners--unless a specific overwrite is configured. It will also disable the command from being usable in DMs.

It would appear that this boolean value should be set on the DiscordCommand model after options.

@EthanC
Copy link
Author

EthanC commented Aug 6, 2021

@ms7m Did you verify that adding default_permission=False to a DiscordCommand functions as expected with the 1.0.0b PR?

Personally, a command with default_permission=False and no other permissions set is still usable by me (the guild owner) in my tests. I'm not sure where the issue lies here.

@ms7m
Copy link
Owner

ms7m commented Aug 6, 2021

Just tested it on mine.

bot.register(
    DiscordCommand(
        name="defaultpermissiontest",
        description="return simple command",
        options=[],
        default_permission=True,
    )
)

Flipping to False made it appear again. How does your command look?

@EthanC
Copy link
Author

EthanC commented Aug 7, 2021

Ah, it was an error on my part, apologies. I had old command permissions that I wasn't aware of which overwrote the default_permission. Functions as expected 👍

@ms7m ms7m added the Fixed in the Next Release This issue will be resolved in the next release. label Aug 7, 2021
@ms7m ms7m closed this as completed in #47 Sep 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Endpoint Updates Fixed in the Next Release This issue will be resolved in the next release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants