|
|
@@ -30,7 +30,7 @@ namespace Discord |
|
|
|
public bool ManageGuild => Permissions.GetValue(RawValue, GuildPermission.ManageGuild); |
|
|
|
/// <summary> If True, a user may view guild audit logs. </summary> |
|
|
|
public bool ViewAuditLog => Permissions.GetValue(RawValue, GuildPermission.ViewAuditLog); |
|
|
|
|
|
|
|
|
|
|
|
/// <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> |
|
|
@@ -79,14 +79,14 @@ namespace Discord |
|
|
|
/// <summary> Creates a new GuildPermissions with the provided packed value. </summary> |
|
|
|
public GuildPermissions(ulong rawValue) { RawValue = rawValue; } |
|
|
|
|
|
|
|
private GuildPermissions(ulong initialValue, bool? createInstantInvite = null, bool? kickMembers = null, |
|
|
|
bool? banMembers = null, bool? administrator = null, bool? manageChannel = null, bool? manageGuild = null, |
|
|
|
bool? viewAuditLog = null, bool? addReactions = null, |
|
|
|
bool? readMessages = null, bool? sendMessages = null, bool? sendTTSMessages = null, bool? manageMessages = null, |
|
|
|
bool? embedLinks = null, bool? attachFiles = null, bool? readMessageHistory = null, bool? mentionEveryone = null, |
|
|
|
bool? userExternalEmojis = null, bool? connect = null, bool? speak = null, bool? muteMembers = null, bool? deafenMembers = null, |
|
|
|
bool? moveMembers = null, bool? useVoiceActivation = null, bool? changeNickname = null, bool? manageNicknames = null, |
|
|
|
bool? manageRoles = null, bool? manageWebhooks = null, bool? manageEmojis = null) |
|
|
|
private GuildPermissions(ulong initialValue, bool? createInstantInvite = null, bool? kickMembers = null, |
|
|
|
bool? banMembers = null, bool? administrator = null, bool? manageChannel = null, bool? manageGuild = null, |
|
|
|
bool? addReactions = null, |
|
|
|
bool? readMessages = null, bool? sendMessages = null, bool? sendTTSMessages = null, bool? manageMessages = null, |
|
|
|
bool? embedLinks = null, bool? attachFiles = null, bool? readMessageHistory = null, bool? mentionEveryone = null, |
|
|
|
bool? userExternalEmojis = null, bool? connect = null, bool? speak = null, bool? muteMembers = null, bool? deafenMembers = null, |
|
|
|
bool? moveMembers = null, bool? useVoiceActivation = null, bool? changeNickname = null, bool? manageNicknames = null, |
|
|
|
bool? manageRoles = null, bool? manageWebhooks = null, bool? manageEmojis = null, bool? viewAuditLog = null) |
|
|
|
{ |
|
|
|
ulong value = initialValue; |
|
|
|
|
|
|
@@ -96,7 +96,6 @@ namespace Discord |
|
|
|
Permissions.SetValue(ref value, administrator, GuildPermission.Administrator); |
|
|
|
Permissions.SetValue(ref value, manageChannel, GuildPermission.ManageChannels); |
|
|
|
Permissions.SetValue(ref value, manageGuild, GuildPermission.ManageGuild); |
|
|
|
Permissions.SetValue(ref value, viewAuditLog, GuildPermission.ViewAuditLog); |
|
|
|
Permissions.SetValue(ref value, addReactions, GuildPermission.AddReactions); |
|
|
|
Permissions.SetValue(ref value, readMessages, GuildPermission.ReadMessages); |
|
|
|
Permissions.SetValue(ref value, sendMessages, GuildPermission.SendMessages); |
|
|
@@ -118,36 +117,39 @@ namespace Discord |
|
|
|
Permissions.SetValue(ref value, manageRoles, GuildPermission.ManageRoles); |
|
|
|
Permissions.SetValue(ref value, manageWebhooks, GuildPermission.ManageWebhooks); |
|
|
|
Permissions.SetValue(ref value, manageEmojis, GuildPermission.ManageEmojis); |
|
|
|
Permissions.SetValue(ref value, viewAuditLog, GuildPermission.ViewAuditLog); |
|
|
|
|
|
|
|
RawValue = value; |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary> Creates a new GuildPermissions with the provided permissions. </summary> |
|
|
|
public GuildPermissions(bool createInstantInvite = false, bool kickMembers = false, |
|
|
|
public GuildPermissions(bool createInstantInvite = false, bool kickMembers = false, |
|
|
|
bool banMembers = false, bool administrator = false, bool manageChannels = false, bool manageGuild = false, |
|
|
|
bool viewAuditLog = false, bool addReactions = false, |
|
|
|
bool addReactions = false, |
|
|
|
bool readMessages = false, bool sendMessages = false, bool sendTTSMessages = false, bool manageMessages = false, |
|
|
|
bool embedLinks = false, bool attachFiles = false, bool readMessageHistory = false, bool mentionEveryone = false, |
|
|
|
bool useExternalEmojis = false, bool connect = false, bool speak = false, bool muteMembers = false, bool deafenMembers = false, |
|
|
|
bool moveMembers = false, bool useVoiceActivation = false, bool? changeNickname = false, bool? manageNicknames = false, |
|
|
|
bool manageRoles = false, bool manageWebhooks = false, bool manageEmojis = false) |
|
|
|
: this(0, createInstantInvite, manageRoles, kickMembers, banMembers, manageChannels, manageGuild, viewAuditLog, addReactions, |
|
|
|
readMessages, sendMessages, sendTTSMessages, manageMessages, embedLinks, attachFiles, mentionEveryone, useExternalEmojis, connect, |
|
|
|
manageWebhooks, manageEmojis) { } |
|
|
|
bool moveMembers = false, bool useVoiceActivation = false, bool? changeNickname = false, bool? manageNicknames = false, |
|
|
|
bool manageRoles = false, bool manageWebhooks = false, bool manageEmojis = false, |
|
|
|
bool viewAuditLog = false) |
|
|
|
: this(0, createInstantInvite, manageRoles, kickMembers, banMembers, manageChannels, manageGuild, addReactions, |
|
|
|
readMessages, sendMessages, sendTTSMessages, manageMessages, embedLinks, attachFiles, mentionEveryone, useExternalEmojis, |
|
|
|
connect, manageWebhooks, manageEmojis, viewAuditLog) |
|
|
|
{ } |
|
|
|
|
|
|
|
/// <summary> Creates a new GuildPermissions from this one, changing the provided non-null permissions. </summary> |
|
|
|
public GuildPermissions Modify(bool? createInstantInvite = null, bool? kickMembers = null, |
|
|
|
public GuildPermissions Modify(bool? createInstantInvite = null, bool? kickMembers = null, |
|
|
|
bool? banMembers = null, bool? administrator = null, bool? manageChannels = null, bool? manageGuild = null, |
|
|
|
bool? viewAuditLog = null, bool? addReactions = null, |
|
|
|
bool? addReactions = null, |
|
|
|
bool? readMessages = null, bool? sendMessages = null, bool? sendTTSMessages = null, bool? manageMessages = null, |
|
|
|
bool? embedLinks = null, bool? attachFiles = null, bool? readMessageHistory = null, bool? mentionEveryone = null, |
|
|
|
bool? useExternalEmojis = null, bool? connect = null, bool? speak = null, bool? muteMembers = null, bool? deafenMembers = null, |
|
|
|
bool? moveMembers = null, bool? useVoiceActivation = null, bool? changeNickname = null, bool? manageNicknames = null, |
|
|
|
bool? manageRoles = null, bool? manageWebhooks = null, bool? manageEmojis = null) |
|
|
|
=> new GuildPermissions(RawValue, createInstantInvite, manageRoles, kickMembers, banMembers, manageChannels, manageGuild, viewAuditLog, |
|
|
|
addReactions, readMessages, sendMessages, sendTTSMessages, manageMessages, embedLinks, attachFiles, mentionEveryone, |
|
|
|
useExternalEmojis, connect, speak, muteMembers, deafenMembers, moveMembers, useVoiceActivation, changeNickname, |
|
|
|
manageNicknames, manageRoles, manageWebhooks, manageEmojis); |
|
|
|
bool? moveMembers = null, bool? useVoiceActivation = null, bool? changeNickname = null, bool? manageNicknames = null, |
|
|
|
bool? manageRoles = null, bool? manageWebhooks = null, bool? manageEmojis = null, bool? viewAuditLog = null) |
|
|
|
=> new GuildPermissions(RawValue, createInstantInvite, manageRoles, kickMembers, banMembers, manageChannels, manageGuild, |
|
|
|
addReactions, readMessages, sendMessages, sendTTSMessages, manageMessages, embedLinks, attachFiles, mentionEveryone, |
|
|
|
useExternalEmojis, connect, speak, muteMembers, deafenMembers, moveMembers, useVoiceActivation, changeNickname, |
|
|
|
manageNicknames, manageRoles, manageWebhooks, manageEmojis, viewAuditLog); |
|
|
|
|
|
|
|
public bool Has(GuildPermission permission) => Permissions.GetValue(RawValue, permission); |
|
|
|
|
|
|
|