Browse Source

Added in an all value for category channels. (#952)

tags/2.0
advorange Christopher F 7 years ago
parent
commit
6d58796f2d
1 changed files with 5 additions and 2 deletions
  1. +5
    -2
      src/Discord.Net.Core/Entities/Permissions/ChannelPermissions.cs

+ 5
- 2
src/Discord.Net.Core/Entities/Permissions/ChannelPermissions.cs View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;


@@ -13,6 +13,8 @@ namespace Discord
public static readonly ChannelPermissions Text = new ChannelPermissions(0b01100_0000000_1111111110001_010001); public static readonly ChannelPermissions Text = new ChannelPermissions(0b01100_0000000_1111111110001_010001);
/// <summary> Gets a ChannelPermissions that grants all permissions for voice channels. </summary> /// <summary> Gets a ChannelPermissions that grants all permissions for voice channels. </summary>
public static readonly ChannelPermissions Voice = new ChannelPermissions(0b00100_1111110_0000000000000_010001); public static readonly ChannelPermissions Voice = new ChannelPermissions(0b00100_1111110_0000000000000_010001);
/// <summary> Gets a ChannelPermissions that grants all permissions for category channels. </summary>
public static readonly ChannelPermissions Category = new ChannelPermissions(0b01100_1111110_1111111110001_010001);
/// <summary> Gets a ChannelPermissions that grants all permissions for direct message channels. </summary> /// <summary> Gets a ChannelPermissions that grants all permissions for direct message channels. </summary>
public static readonly ChannelPermissions DM = new ChannelPermissions(0b00000_1000110_1011100110000_000000); public static readonly ChannelPermissions DM = new ChannelPermissions(0b00000_1000110_1011100110000_000000);
/// <summary> Gets a ChannelPermissions that grants all permissions for group channels. </summary> /// <summary> Gets a ChannelPermissions that grants all permissions for group channels. </summary>
@@ -24,6 +26,7 @@ namespace Discord
{ {
case ITextChannel _: return Text; case ITextChannel _: return Text;
case IVoiceChannel _: return Voice; case IVoiceChannel _: return Voice;
case ICategoryChannel _: return Category;
case IDMChannel _: return DM; case IDMChannel _: return DM;
case IGroupChannel _: return Group; case IGroupChannel _: return Group;
default: throw new ArgumentException("Unknown channel type", nameof(channel)); default: throw new ArgumentException("Unknown channel type", nameof(channel));
@@ -157,4 +160,4 @@ namespace Discord
public override string ToString() => RawValue.ToString(); public override string ToString() => RawValue.ToString();
private string DebuggerDisplay => $"{string.Join(", ", ToList())}"; private string DebuggerDisplay => $"{string.Join(", ", ToList())}";
} }
}
}

Loading…
Cancel
Save