diff --git a/src/Discord.Net/Models/Permissions.cs b/src/Discord.Net/Models/Permissions.cs index b0849d29b..1a8824946 100644 --- a/src/Discord.Net/Models/Permissions.cs +++ b/src/Discord.Net/Models/Permissions.cs @@ -58,11 +58,12 @@ namespace Discord public static readonly ChannelPermissions TextOnly = Preset("00000000000000111111110000011001"); public static readonly ChannelPermissions PrivateOnly = Preset("00000000000000011100110000000000"); public static readonly ChannelPermissions VoiceOnly = Preset("00000011111100000000000000011001"); - public static ChannelPermissions All(Channel channel) + public static ChannelPermissions All(Channel channel) => All(channel.Type, channel.IsPrivate); + public static ChannelPermissions All(string channelType, bool isPrivate) { - if (channel.IsPrivate) return PrivateOnly; - else if (channel.Type == ChannelTypes.Text) return TextOnly; - else if (channel.Type == ChannelTypes.Voice) return VoiceOnly; + if (isPrivate) return PrivateOnly; + else if (channelType == ChannelTypes.Text) return TextOnly; + else if (channelType == ChannelTypes.Voice) return VoiceOnly; else return None; }