discord-net / Discord.Net

An unofficial .Net wrapper for the Discord API (https://discord.com/)
https://discordnet.dev
MIT License
3.34k stars 737 forks source link

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

Open BlackDevil115 opened 2 months ago

BlackDevil115 commented 2 months ago

Check The Docs

Verify Issue Source

Check your 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

-

Misha-133 commented 1 month ago

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