diff --git a/src/Discord.Net.Core/Entities/Permissions/ChannelPermissions.cs b/src/Discord.Net.Core/Entities/Permissions/ChannelPermissions.cs index ee5c9984a..3c6a804c5 100644 --- a/src/Discord.Net.Core/Entities/Permissions/ChannelPermissions.cs +++ b/src/Discord.Net.Core/Entities/Permissions/ChannelPermissions.cs @@ -7,30 +7,55 @@ namespace Discord [DebuggerDisplay("{DebuggerDisplay,nq}")] public struct ChannelPermissions { - /// Gets a blank that grants no permissions. - /// A structure that does not contain any set permissions. - public static readonly ChannelPermissions None = new ChannelPermissions(); - /// Gets a that grants all permissions for text channels. - public static readonly ChannelPermissions Text = new ChannelPermissions(0b0_11111_0101100_0000000_1111111110001_010001); - /// Gets a that grants all permissions for voice channels. - public static readonly ChannelPermissions Voice = new ChannelPermissions(0b1_00000_0000100_1111110_0000000011100_010001); - /// Gets a that grants all permissions for stage channels. - public static readonly ChannelPermissions Stage = new ChannelPermissions(0b0_00000_1000100_0111010_0000000010000_010001); - /// Gets a that grants all permissions for category channels. - public static readonly ChannelPermissions Category = new ChannelPermissions(0b01100_1111110_1111111110001_010001); - /// Gets a that grants all permissions for direct message channels. - public static readonly ChannelPermissions DM = new ChannelPermissions(0b00000_1000110_1011100110001_000000); - /// Gets a that grants all permissions for group channels. - public static readonly ChannelPermissions Group = new ChannelPermissions(0b00000_1000110_0001101100000_000000); - /// Gets a that grants all permissions for a given channel type. + /// + /// Gets a blank that grants no permissions. + /// + /// + /// A structure that does not contain any set permissions. + /// + public static readonly ChannelPermissions None = new(); + + /// + /// Gets a that grants all permissions for text channels. + /// + public static readonly ChannelPermissions Text = new(0b0_11111_0101100_0000000_1111111110001_010001); + + /// + /// Gets a that grants all permissions for voice channels. + /// + public static readonly ChannelPermissions Voice = new(0b1_11111_0101100_1111110_1111111111101_010001); // (0b1_00000_0000100_1111110_0000000011100_010001 (<- voice only perms) |= Text) + + /// + /// Gets a that grants all permissions for stage channels. + /// + public static readonly ChannelPermissions Stage = new(0b0_00000_1000100_0111010_0000000010000_010001); + + /// + /// Gets a that grants all permissions for category channels. + /// + public static readonly ChannelPermissions Category = new(0b01100_1111110_1111111110001_010001); + + /// + /// Gets a that grants all permissions for direct message channels. + /// + public static readonly ChannelPermissions DM = new(0b00000_1000110_1011100110001_000000); + + /// + /// Gets a that grants all permissions for group channels. + /// + public static readonly ChannelPermissions Group = new(0b00000_1000110_0001101100000_000000); + + /// + /// Gets a that grants all permissions for a given channel type. + /// /// Unknown channel type. public static ChannelPermissions All(IChannel channel) { return channel switch { - ITextChannel _ => Text, IStageChannel _ => Stage, IVoiceChannel _ => Voice, + ITextChannel _ => Text, ICategoryChannel _ => Category, IDMChannel _ => DM, IGroupChannel _ => Group,