@@ -11,6 +11,7 @@ | |||||
//ManageGuild = 5, | //ManageGuild = 5, | ||||
//Text | //Text | ||||
AddReactions = 6, | |||||
ReadMessages = 10, | ReadMessages = 10, | ||||
SendMessages = 11, | SendMessages = 11, | ||||
SendTTSMessages = 12, | SendTTSMessages = 12, | ||||
@@ -10,7 +10,7 @@ namespace Discord | |||||
//TODO: C#7 Candidate for binary literals | //TODO: C#7 Candidate for binary literals | ||||
private static ChannelPermissions _allDM { get; } = new ChannelPermissions(Convert.ToUInt64("00000000000001011100110000000000", 2)); | private static ChannelPermissions _allDM { get; } = new ChannelPermissions(Convert.ToUInt64("00000000000001011100110000000000", 2)); | ||||
private static ChannelPermissions _allVoice { get; } = new ChannelPermissions(Convert.ToUInt64("00010011111100000000000000010001", 2)); | private static ChannelPermissions _allVoice { get; } = new ChannelPermissions(Convert.ToUInt64("00010011111100000000000000010001", 2)); | ||||
private static ChannelPermissions _allText { get; } = new ChannelPermissions(Convert.ToUInt64("00010000000001111111110000010001", 2)); | |||||
private static ChannelPermissions _allText { get; } = new ChannelPermissions(Convert.ToUInt64("00010000000001111111110001010001", 2)); | |||||
private static ChannelPermissions _allGroup { get; } = new ChannelPermissions(Convert.ToUInt64("00000000000001111110110000000000", 2)); | private static ChannelPermissions _allGroup { get; } = new ChannelPermissions(Convert.ToUInt64("00000000000001111110110000000000", 2)); | ||||
/// <summary> Gets a blank ChannelPermissions that grants no permissions. </summary> | /// <summary> Gets a blank ChannelPermissions that grants no permissions. </summary> | ||||
@@ -35,6 +35,8 @@ namespace Discord | |||||
/// <summary> If True, a user may create, delete and modify this channel. </summary> | /// <summary> If True, a user may create, delete and modify this channel. </summary> | ||||
public bool ManageChannel => Permissions.GetValue(RawValue, ChannelPermission.ManageChannel); | public bool ManageChannel => Permissions.GetValue(RawValue, ChannelPermission.ManageChannel); | ||||
/// <summary> If true, a user may add reactions. </summary> | |||||
public bool AddReactions => Permissions.GetValue(RawValue, ChannelPermission.AddReactions); | |||||
/// <summary> If True, a user may join channels. </summary> | /// <summary> If True, a user may join channels. </summary> | ||||
public bool ReadMessages => Permissions.GetValue(RawValue, ChannelPermission.ReadMessages); | public bool ReadMessages => Permissions.GetValue(RawValue, ChannelPermission.ReadMessages); | ||||
/// <summary> If True, a user may send messages. </summary> | /// <summary> If True, a user may send messages. </summary> | ||||
@@ -11,6 +11,7 @@ | |||||
ManageGuild = 5, | ManageGuild = 5, | ||||
//Text | //Text | ||||
AddReactions = 6, | |||||
ReadMessages = 10, | ReadMessages = 10, | ||||
SendMessages = 11, | SendMessages = 11, | ||||
SendTTSMessages = 12, | SendTTSMessages = 12, | ||||
@@ -11,7 +11,7 @@ namespace Discord | |||||
public static readonly GuildPermissions None = new GuildPermissions(); | public static readonly GuildPermissions None = new GuildPermissions(); | ||||
/// <summary> Gets a GuildPermissions that grants all permissions. </summary> | /// <summary> Gets a GuildPermissions that grants all permissions. </summary> | ||||
//TODO: C#7 Candidate for binary literals | //TODO: C#7 Candidate for binary literals | ||||
public static readonly GuildPermissions All = new GuildPermissions(Convert.ToUInt64("01111111111100111111110000111111", 2)); | |||||
public static readonly GuildPermissions All = new GuildPermissions(Convert.ToUInt64("01111111111100111111110001111111", 2)); | |||||
/// <summary> Gets a packed value representing all the permissions in this GuildPermissions. </summary> | /// <summary> Gets a packed value representing all the permissions in this GuildPermissions. </summary> | ||||
public ulong RawValue { get; } | public ulong RawValue { get; } | ||||
@@ -28,7 +28,9 @@ namespace Discord | |||||
public bool ManageChannels => Permissions.GetValue(RawValue, GuildPermission.ManageChannels); | public bool ManageChannels => Permissions.GetValue(RawValue, GuildPermission.ManageChannels); | ||||
/// <summary> If True, a user may adjust guild properties. </summary> | /// <summary> If True, a user may adjust guild properties. </summary> | ||||
public bool ManageGuild => Permissions.GetValue(RawValue, GuildPermission.ManageGuild); | public bool ManageGuild => Permissions.GetValue(RawValue, GuildPermission.ManageGuild); | ||||
/// <summary> If true, a user may add reactions. </summary> | |||||
public bool AddReactions => Permissions.GetValue(RawValue, GuildPermission.AddReactions); | |||||
/// <summary> If True, a user may join channels. </summary> | /// <summary> If True, a user may join channels. </summary> | ||||
public bool ReadMessages => Permissions.GetValue(RawValue, GuildPermission.ReadMessages); | public bool ReadMessages => Permissions.GetValue(RawValue, GuildPermission.ReadMessages); | ||||
/// <summary> If True, a user may send messages. </summary> | /// <summary> If True, a user may send messages. </summary> | ||||