Skip to content

Commit

Permalink
Added in an all value for category channels. (discord-net#952)
Browse files Browse the repository at this point in the history
  • Loading branch information
advorange authored and FiniteReality committed May 5, 2018
1 parent 0ffb1ab commit ca98836
Showing 1 changed file with 5 additions and 2 deletions.
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Diagnostics;

Expand All @@ -13,6 +13,8 @@ public struct ChannelPermissions
public static readonly ChannelPermissions Text = new ChannelPermissions(0b01100_0000000_1111111110001_010001);
/// <summary> Gets a ChannelPermissions that grants all permissions for voice channels. </summary>
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>
public static readonly ChannelPermissions DM = new ChannelPermissions(0b00000_1000110_1011100110000_000000);
/// <summary> Gets a ChannelPermissions that grants all permissions for group channels. </summary>
Expand All @@ -24,6 +26,7 @@ public static ChannelPermissions All(IChannel channel)
{
case ITextChannel _: return Text;
case IVoiceChannel _: return Voice;
case ICategoryChannel _: return Category;
case IDMChannel _: return DM;
case IGroupChannel _: return Group;
default: throw new ArgumentException("Unknown channel type", nameof(channel));
Expand Down Expand Up @@ -157,4 +160,4 @@ public List<ChannelPermission> ToList()
public override string ToString() => RawValue.ToString();
private string DebuggerDisplay => $"{string.Join(", ", ToList())}";
}
}
}

0 comments on commit ca98836

Please sign in to comment.