/// <summary> /// Initializes a new <see cref="OverwritePermissions" /> from the current one, changing the provided /// non-null permissions. /// </summary> public OverwritePermissions Modify( PermValue?createInstantInvite = null, PermValue?manageChannel = null, PermValue?addReactions = null, PermValue?viewChannel = null, PermValue?sendMessages = null, PermValue?sendTTSMessages = null, PermValue?manageMessages = null, PermValue?embedLinks = null, PermValue?attachFiles = null, PermValue?readMessageHistory = null, PermValue?mentionEveryone = null, PermValue?useExternalEmojis = null, PermValue?connect = null, PermValue?speak = null, PermValue?muteMembers = null, PermValue?deafenMembers = null, PermValue?moveMembers = null, PermValue?useVoiceActivation = null, PermValue?manageRoles = null, PermValue?manageWebhooks = null, PermValue?prioritySpeaker = null, PermValue?stream = null) => new OverwritePermissions(AllowValue, DenyValue, createInstantInvite, manageChannel, addReactions, viewChannel, sendMessages, sendTTSMessages, manageMessages, embedLinks, attachFiles, readMessageHistory, mentionEveryone, useExternalEmojis, connect, speak, muteMembers, deafenMembers, moveMembers, useVoiceActivation, manageRoles, manageWebhooks, prioritySpeaker, stream);
private OverwritePermissions(ulong allowValue, ulong denyValue, PermValue?createInstantInvite = null, PermValue?manageChannel = null, PermValue?addReactions = null, PermValue?readMessages = null, PermValue?sendMessages = null, PermValue?sendTTSMessages = null, PermValue?manageMessages = null, PermValue?embedLinks = null, PermValue?attachFiles = null, PermValue?readMessageHistory = null, PermValue?mentionEveryone = null, PermValue?useExternalEmojis = null, PermValue?connect = null, PermValue?speak = null, PermValue?muteMembers = null, PermValue?deafenMembers = null, PermValue?moveMembers = null, PermValue?useVoiceActivation = null, PermValue?manageRoles = null, PermValue?manageWebhooks = null) { Permissions.SetValue(ref allowValue, ref denyValue, createInstantInvite, ChannelPermission.CreateInstantInvite); Permissions.SetValue(ref allowValue, ref denyValue, manageChannel, ChannelPermission.ManageChannels); Permissions.SetValue(ref allowValue, ref denyValue, addReactions, ChannelPermission.AddReactions); Permissions.SetValue(ref allowValue, ref denyValue, readMessages, ChannelPermission.ReadMessages); Permissions.SetValue(ref allowValue, ref denyValue, sendMessages, ChannelPermission.SendMessages); Permissions.SetValue(ref allowValue, ref denyValue, sendTTSMessages, ChannelPermission.SendTTSMessages); Permissions.SetValue(ref allowValue, ref denyValue, manageMessages, ChannelPermission.ManageMessages); Permissions.SetValue(ref allowValue, ref denyValue, embedLinks, ChannelPermission.EmbedLinks); Permissions.SetValue(ref allowValue, ref denyValue, attachFiles, ChannelPermission.AttachFiles); Permissions.SetValue(ref allowValue, ref denyValue, readMessageHistory, ChannelPermission.ReadMessageHistory); Permissions.SetValue(ref allowValue, ref denyValue, mentionEveryone, ChannelPermission.MentionEveryone); Permissions.SetValue(ref allowValue, ref denyValue, useExternalEmojis, ChannelPermission.UseExternalEmojis); Permissions.SetValue(ref allowValue, ref denyValue, connect, ChannelPermission.Connect); Permissions.SetValue(ref allowValue, ref denyValue, speak, ChannelPermission.Speak); Permissions.SetValue(ref allowValue, ref denyValue, muteMembers, ChannelPermission.MuteMembers); Permissions.SetValue(ref allowValue, ref denyValue, deafenMembers, ChannelPermission.DeafenMembers); Permissions.SetValue(ref allowValue, ref denyValue, moveMembers, ChannelPermission.MoveMembers); Permissions.SetValue(ref allowValue, ref denyValue, useVoiceActivation, ChannelPermission.UseVAD); Permissions.SetValue(ref allowValue, ref denyValue, manageRoles, ChannelPermission.ManageRoles); Permissions.SetValue(ref allowValue, ref denyValue, manageWebhooks, ChannelPermission.ManageWebhooks); AllowValue = allowValue; DenyValue = denyValue; }
public ChannelPermissionOverrides(ChannelPermissionOverrides basePerms, PermValue?createInstantInvite = null, PermValue?managePermissions = null, PermValue?manageChannel = null, PermValue?readMessages = null, PermValue?sendMessages = null, PermValue?sendTTSMessages = null, PermValue?manageMessages = null, PermValue?embedLinks = null, PermValue?attachFiles = null, PermValue?readMessageHistory = null, PermValue?mentionEveryone = null, PermValue?connect = null, PermValue?speak = null, PermValue?muteMembers = null, PermValue?deafenMembers = null, PermValue?moveMembers = null, PermValue?useVoiceActivation = null) { uint allow = basePerms.AllowValue, deny = basePerms.DenyValue; PermissionsHelper.SetValue(ref allow, ref deny, createInstantInvite, PermissionBits.CreateInstantInvite); PermissionsHelper.SetValue(ref allow, ref deny, managePermissions, PermissionBits.ManageRolesOrPermissions); PermissionsHelper.SetValue(ref allow, ref deny, manageChannel, PermissionBits.ManageChannel); PermissionsHelper.SetValue(ref allow, ref deny, readMessages, PermissionBits.ReadMessages); PermissionsHelper.SetValue(ref allow, ref deny, sendMessages, PermissionBits.SendMessages); PermissionsHelper.SetValue(ref allow, ref deny, sendTTSMessages, PermissionBits.SendTTSMessages); PermissionsHelper.SetValue(ref allow, ref deny, manageMessages, PermissionBits.ManageMessages); PermissionsHelper.SetValue(ref allow, ref deny, embedLinks, PermissionBits.EmbedLinks); PermissionsHelper.SetValue(ref allow, ref deny, attachFiles, PermissionBits.AttachFiles); PermissionsHelper.SetValue(ref allow, ref deny, readMessageHistory, PermissionBits.ReadMessageHistory); PermissionsHelper.SetValue(ref allow, ref deny, mentionEveryone, PermissionBits.MentionEveryone); PermissionsHelper.SetValue(ref allow, ref deny, connect, PermissionBits.Connect); PermissionsHelper.SetValue(ref allow, ref deny, speak, PermissionBits.Speak); PermissionsHelper.SetValue(ref allow, ref deny, muteMembers, PermissionBits.MuteMembers); PermissionsHelper.SetValue(ref allow, ref deny, deafenMembers, PermissionBits.DeafenMembers); PermissionsHelper.SetValue(ref allow, ref deny, moveMembers, PermissionBits.MoveMembers); PermissionsHelper.SetValue(ref allow, ref deny, useVoiceActivation, PermissionBits.UseVoiceActivation); AllowValue = allow; DenyValue = deny; }
public OverwritePermissions(PermValue?createInstantInvite = null, PermValue?managePermissions = null, PermValue?manageChannel = null, PermValue?readMessages = null, PermValue?sendMessages = null, PermValue?sendTTSMessages = null, PermValue?manageMessages = null, PermValue?embedLinks = null, PermValue?attachFiles = null, PermValue?readMessageHistory = null, PermValue?mentionEveryone = null, PermValue?connect = null, PermValue?speak = null, PermValue?muteMembers = null, PermValue?deafenMembers = null, PermValue?moveMembers = null, PermValue?useVoiceActivation = null) : this() { }
public ChannelPermissionOverrides(PermValue?createInstantInvite = null, PermValue?managePermissions = null, PermValue?manageChannel = null, PermValue?readMessages = null, PermValue?sendMessages = null, PermValue?sendTTSMessages = null, PermValue?manageMessages = null, PermValue?embedLinks = null, PermValue?attachFiles = null, PermValue?readMessageHistory = null, PermValue?mentionEveryone = null, PermValue?connect = null, PermValue?speak = null, PermValue?muteMembers = null, PermValue?deafenMembers = null, PermValue?moveMembers = null, PermValue?useVoiceActivation = null) : this(new ChannelPermissionOverrides(), createInstantInvite, managePermissions, manageChannel, readMessages, sendMessages, sendTTSMessages, manageMessages, embedLinks, attachFiles, mentionEveryone, connect, speak, muteMembers, deafenMembers, moveMembers, useVoiceActivation) { }
public static void SetValue(ref ulong allow, ref ulong deny, PermValue?value, byte bit) { if (value.HasValue) { switch (value) { case PermValue.Allow: SetBit(ref allow, bit); UnsetBit(ref deny, bit); break; case PermValue.Deny: UnsetBit(ref allow, bit); SetBit(ref deny, bit); break; default: UnsetBit(ref allow, bit); UnsetBit(ref deny, bit); break; } } }
public static void SetValue(ref ulong allow, ref ulong deny, PermValue?value, ulong flag) { if (value.HasValue) { switch (value) { case PermValue.Allow: SetFlag(ref allow, flag); UnsetFlag(ref deny, flag); break; case PermValue.Deny: UnsetFlag(ref allow, flag); SetFlag(ref deny, flag); break; default: UnsetFlag(ref allow, flag); UnsetFlag(ref deny, flag); break; } } }
public static void SetValue(ref uint allow, ref uint deny, PermValue?value, PermissionBits bit) { if (value.HasValue) { switch (value) { case PermValue.Allow: SetBit(ref allow, bit); UnsetBit(ref deny, bit); break; case PermValue.Deny: UnsetBit(ref allow, bit); SetBit(ref deny, bit); break; default: UnsetBit(ref allow, bit); UnsetBit(ref deny, bit); break; } } }
public static void SetValue(ref ulong allow, ref ulong deny, PermValue?value, GuildPermission bit) => SetValue(ref allow, ref deny, value, (byte)bit);
public static void SetValue(ref ulong allow, ref ulong deny, PermValue?value, GuildPermission flag) => SetValue(ref allow, ref deny, value, (ulong)flag);
private OverwritePermissions(ulong allowValue, ulong denyValue, PermValue?createInstantInvite = null, PermValue?manageChannel = null, PermValue?addReactions = null, PermValue?viewChannel = null, PermValue?sendMessages = null, PermValue?sendTTSMessages = null, PermValue?manageMessages = null, PermValue?embedLinks = null, PermValue?attachFiles = null, PermValue?readMessageHistory = null, PermValue?mentionEveryone = null, PermValue?useExternalEmojis = null, PermValue?connect = null, PermValue?speak = null, PermValue?muteMembers = null, PermValue?deafenMembers = null, PermValue?moveMembers = null, PermValue?useVoiceActivation = null, PermValue?manageRoles = null, PermValue?manageWebhooks = null, PermValue?prioritySpeaker = null, PermValue?stream = null, PermValue?useSlashCommands = null, PermValue?useApplicationCommands = null, PermValue?requestToSpeak = null, PermValue?manageThreads = null, PermValue?createPublicThreads = null, PermValue?createPrivateThreads = null, PermValue?usePublicThreads = null, PermValue?usePrivateThreads = null, PermValue?useExternalStickers = null, PermValue?sendMessagesInThreads = null, PermValue?startEmbeddedActivities = null) { Permissions.SetValue(ref allowValue, ref denyValue, createInstantInvite, ChannelPermission.CreateInstantInvite); Permissions.SetValue(ref allowValue, ref denyValue, manageChannel, ChannelPermission.ManageChannels); Permissions.SetValue(ref allowValue, ref denyValue, addReactions, ChannelPermission.AddReactions); Permissions.SetValue(ref allowValue, ref denyValue, viewChannel, ChannelPermission.ViewChannel); Permissions.SetValue(ref allowValue, ref denyValue, sendMessages, ChannelPermission.SendMessages); Permissions.SetValue(ref allowValue, ref denyValue, sendTTSMessages, ChannelPermission.SendTTSMessages); Permissions.SetValue(ref allowValue, ref denyValue, manageMessages, ChannelPermission.ManageMessages); Permissions.SetValue(ref allowValue, ref denyValue, embedLinks, ChannelPermission.EmbedLinks); Permissions.SetValue(ref allowValue, ref denyValue, attachFiles, ChannelPermission.AttachFiles); Permissions.SetValue(ref allowValue, ref denyValue, readMessageHistory, ChannelPermission.ReadMessageHistory); Permissions.SetValue(ref allowValue, ref denyValue, mentionEveryone, ChannelPermission.MentionEveryone); Permissions.SetValue(ref allowValue, ref denyValue, useExternalEmojis, ChannelPermission.UseExternalEmojis); Permissions.SetValue(ref allowValue, ref denyValue, connect, ChannelPermission.Connect); Permissions.SetValue(ref allowValue, ref denyValue, speak, ChannelPermission.Speak); Permissions.SetValue(ref allowValue, ref denyValue, muteMembers, ChannelPermission.MuteMembers); Permissions.SetValue(ref allowValue, ref denyValue, deafenMembers, ChannelPermission.DeafenMembers); Permissions.SetValue(ref allowValue, ref denyValue, moveMembers, ChannelPermission.MoveMembers); Permissions.SetValue(ref allowValue, ref denyValue, useVoiceActivation, ChannelPermission.UseVAD); Permissions.SetValue(ref allowValue, ref denyValue, prioritySpeaker, ChannelPermission.PrioritySpeaker); Permissions.SetValue(ref allowValue, ref denyValue, stream, ChannelPermission.Stream); Permissions.SetValue(ref allowValue, ref denyValue, manageRoles, ChannelPermission.ManageRoles); Permissions.SetValue(ref allowValue, ref denyValue, manageWebhooks, ChannelPermission.ManageWebhooks); Permissions.SetValue(ref allowValue, ref denyValue, useApplicationCommands, ChannelPermission.UseApplicationCommands); Permissions.SetValue(ref allowValue, ref denyValue, requestToSpeak, ChannelPermission.RequestToSpeak); Permissions.SetValue(ref allowValue, ref denyValue, manageThreads, ChannelPermission.ManageThreads); Permissions.SetValue(ref allowValue, ref denyValue, createPublicThreads, ChannelPermission.CreatePublicThreads); Permissions.SetValue(ref allowValue, ref denyValue, createPrivateThreads, ChannelPermission.CreatePrivateThreads); Permissions.SetValue(ref allowValue, ref denyValue, useExternalStickers, ChannelPermission.UseExternalStickers); Permissions.SetValue(ref allowValue, ref denyValue, sendMessagesInThreads, ChannelPermission.SendMessagesInThreads); Permissions.SetValue(ref allowValue, ref denyValue, startEmbeddedActivities, ChannelPermission.StartEmbeddedActivities); AllowValue = allowValue; DenyValue = denyValue; }