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

[Bug]: DefaultMemberPermissions(0) not handled correct on a single command #3011

Open
3 tasks done
BlackDevil115 opened this issue Sep 17, 2024 · 1 comment
Open
3 tasks done

Comments

@BlackDevil115
Copy link

Check The Docs

  • I double checked the docs and couldn't find any useful information.

Verify Issue Source

  • I verified the issue was caused by Discord.Net.

Check your intents

  • I double checked that I have the required intents.

Description

When [DefaultMemberPermissions(0)] is used on a single command library output its a null and not as 0.
Expected outcome is 0 as default permissions what should result in Administrator Only on the command

..\src\Discord.Net.Interactions\Utilities\ApplicationCommandRestUtil.cs

        public static GuildPermission? SanitizeGuildPermissions(this GuildPermission permissions) =>
            permissions == 0 ? null : permissions;

When [DefaultMemberPermissions(0)] is used with a group command then this behaviour works as it should.
And this results on Discord as Adminstrator Only Command

Version

3.16.0

Working Version

No response

Logs

-

Sample

No response

Packages

Environment

@BlackDevil115 BlackDevil115 changed the title [Bug]: [Bug]: DefaultMemberPermissions(0) not handled correnct on a single command Sep 17, 2024
@BlackDevil115 BlackDevil115 changed the title [Bug]: DefaultMemberPermissions(0) not handled correnct on a single command [Bug]: DefaultMemberPermissions(0) not handled correct on a single command Sep 17, 2024
@Misha-133
Copy link
Member

Hey!
While that is technically correct, changing it at this point would introduce a breaking change;
We might change it in v4, but until then you could set the permission to Administrator

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

No branches or pull requests

2 participants