Struct OverwritePermissions
- Namespace
- Discord
- Assembly
- Discord.Net.Core.dll
Represents a container for a series of overwrite permissions.
public struct OverwritePermissions
- Inherited Members
Constructors
OverwritePermissions(PermValue, PermValue, PermValue, PermValue, PermValue, PermValue, PermValue, PermValue, PermValue, PermValue, PermValue, PermValue, PermValue, PermValue, PermValue, PermValue, PermValue, PermValue, PermValue, PermValue, PermValue, PermValue, PermValue, PermValue, PermValue, PermValue, PermValue, PermValue, PermValue, PermValue, PermValue, PermValue, PermValue)
Initializes a new ChannelPermissions struct with the provided permissions.
public OverwritePermissions(PermValue createInstantInvite = PermValue.Inherit, PermValue manageChannel = PermValue.Inherit, PermValue addReactions = PermValue.Inherit, PermValue viewChannel = PermValue.Inherit, PermValue sendMessages = PermValue.Inherit, PermValue sendTTSMessages = PermValue.Inherit, PermValue manageMessages = PermValue.Inherit, PermValue embedLinks = PermValue.Inherit, PermValue attachFiles = PermValue.Inherit, PermValue readMessageHistory = PermValue.Inherit, PermValue mentionEveryone = PermValue.Inherit, PermValue useExternalEmojis = PermValue.Inherit, PermValue connect = PermValue.Inherit, PermValue speak = PermValue.Inherit, PermValue muteMembers = PermValue.Inherit, PermValue deafenMembers = PermValue.Inherit, PermValue moveMembers = PermValue.Inherit, PermValue useVoiceActivation = PermValue.Inherit, PermValue manageRoles = PermValue.Inherit, PermValue manageWebhooks = PermValue.Inherit, PermValue prioritySpeaker = PermValue.Inherit, PermValue stream = PermValue.Inherit, PermValue useSlashCommands = PermValue.Inherit, PermValue useApplicationCommands = PermValue.Inherit, PermValue requestToSpeak = PermValue.Inherit, PermValue manageThreads = PermValue.Inherit, PermValue createPublicThreads = PermValue.Inherit, PermValue createPrivateThreads = PermValue.Inherit, PermValue usePublicThreads = PermValue.Inherit, PermValue usePrivateThreads = PermValue.Inherit, PermValue useExternalStickers = PermValue.Inherit, PermValue sendMessagesInThreads = PermValue.Inherit, PermValue startEmbeddedActivities = PermValue.Inherit)
Parameters
createInstantInvite
PermValuemanageChannel
PermValueaddReactions
PermValueviewChannel
PermValuesendMessages
PermValuesendTTSMessages
PermValuemanageMessages
PermValueembedLinks
PermValueattachFiles
PermValuereadMessageHistory
PermValuementionEveryone
PermValueuseExternalEmojis
PermValueconnect
PermValuespeak
PermValuemuteMembers
PermValuedeafenMembers
PermValuemoveMembers
PermValueuseVoiceActivation
PermValuemanageRoles
PermValuemanageWebhooks
PermValueprioritySpeaker
PermValuestream
PermValueuseSlashCommands
PermValueuseApplicationCommands
PermValuerequestToSpeak
PermValuemanageThreads
PermValuecreatePublicThreads
PermValuecreatePrivateThreads
PermValueusePublicThreads
PermValueusePrivateThreads
PermValueuseExternalStickers
PermValuesendMessagesInThreads
PermValuestartEmbeddedActivities
PermValue
OverwritePermissions(string, string)
Creates a new OverwritePermissions with the provided allow and deny packed values after converting to ulong.
public OverwritePermissions(string allowValue, string denyValue)
Parameters
OverwritePermissions(ulong, ulong)
Creates a new OverwritePermissions with the provided allow and deny packed values.
public OverwritePermissions(ulong allowValue, ulong denyValue)
Parameters
Properties
AddReactions
If Allowed, a user may add reactions.
public PermValue AddReactions { get; }
Property Value
AllowValue
Gets a packed value representing all the allowed permissions in this OverwritePermissions.
public readonly ulong AllowValue { get; }
Property Value
AttachFiles
If Allowed, a user may send files.
public PermValue AttachFiles { get; }
Property Value
Connect
If Allowed, a user may connect to a voice channel.
public PermValue Connect { get; }
Property Value
CreateInstantInvite
If Allowed, a user may create invites.
public PermValue CreateInstantInvite { get; }
Property Value
CreatePrivateThreads
If true, a user may create private threads in this guild.
public PermValue CreatePrivateThreads { get; }
Property Value
CreatePublicThreads
If true, a user may create public threads in this guild.
public PermValue CreatePublicThreads { get; }
Property Value
DeafenMembers
If Allowed, a user may deafen users.
public PermValue DeafenMembers { get; }
Property Value
DenyValue
Gets a packed value representing all the denied permissions in this OverwritePermissions.
public readonly ulong DenyValue { get; }
Property Value
EmbedLinks
If Allowed, Discord will auto-embed links sent by this user.
public PermValue EmbedLinks { get; }
Property Value
InheritAll
Gets a blank OverwritePermissions that inherits all permissions.
public static OverwritePermissions InheritAll { get; }
Property Value
ManageChannel
If Allowed, a user may create, delete and modify this channel.
public PermValue ManageChannel { get; }
Property Value
ManageMessages
If Allowed, a user may delete messages.
public PermValue ManageMessages { get; }
Property Value
ManageRoles
If Allowed, a user may adjust role permissions. This also implicitly grants all other permissions.
public PermValue ManageRoles { get; }
Property Value
ManageThreads
If true, a user may manage threads in this guild.
public PermValue ManageThreads { get; }
Property Value
ManageWebhooks
If True, a user may edit the webhooks for this channel.
public PermValue ManageWebhooks { get; }
Property Value
MentionEveryone
If Allowed, a user may mention @everyone.
public PermValue MentionEveryone { get; }
Property Value
MoveMembers
If Allowed, a user may move other users between voice channels.
public PermValue MoveMembers { get; }
Property Value
MuteMembers
If Allowed, a user may mute users.
public PermValue MuteMembers { get; }
Property Value
PrioritySpeaker
If Allowed, a user may use priority speaker in a voice channel.
public PermValue PrioritySpeaker { get; }
Property Value
ReadMessageHistory
If Allowed, a user may read previous messages.
public PermValue ReadMessageHistory { get; }
Property Value
RequestToSpeak
If true, a user may request to speak in stage channels.
public PermValue RequestToSpeak { get; }
Property Value
SendMessages
If Allowed, a user may send messages.
public PermValue SendMessages { get; }
Property Value
SendMessagesInThreads
If true, a user may send messages in threads in this guild.
public PermValue SendMessagesInThreads { get; }
Property Value
SendTTSMessages
If Allowed, a user may send text-to-speech messages.
public PermValue SendTTSMessages { get; }
Property Value
Speak
If Allowed, a user may speak in a voice channel.
public PermValue Speak { get; }
Property Value
StartEmbeddedActivities
If true, a user launch application activities in voice channels in this guild.
public PermValue StartEmbeddedActivities { get; }
Property Value
Stream
If Allowed, a user may go live in a voice channel.
public PermValue Stream { get; }
Property Value
UseApplicationCommands
If true, a user may use slash commands in this guild.
public PermValue UseApplicationCommands { get; }
Property Value
UseExternalEmojis
If Allowed, a user may use custom emoji from other guilds.
public PermValue UseExternalEmojis { get; }
Property Value
UseExternalStickers
If true, a user may use external stickers in this guild.
public PermValue UseExternalStickers { get; }
Property Value
UseVAD
If Allowed, a user may use voice-activity-detection rather than push-to-talk.
public PermValue UseVAD { get; }
Property Value
ViewChannel
If Allowed, a user may join channels.
public PermValue ViewChannel { get; }
Property Value
Methods
AllowAll(IChannel)
Gets a OverwritePermissions that grants all permissions for the given channel.
public static OverwritePermissions AllowAll(IChannel channel)
Parameters
channel
IChannel
Returns
Exceptions
- ArgumentException
Unknown channel type.
DenyAll(IChannel)
Gets a OverwritePermissions that denies all permissions for the given channel.
public static OverwritePermissions DenyAll(IChannel channel)
Parameters
channel
IChannel
Returns
Exceptions
- ArgumentException
Unknown channel type.
Modify(PermValue?, PermValue?, PermValue?, PermValue?, PermValue?, PermValue?, PermValue?, PermValue?, PermValue?, PermValue?, PermValue?, PermValue?, PermValue?, PermValue?, PermValue?, PermValue?, PermValue?, PermValue?, PermValue?, PermValue?, PermValue?, PermValue?, PermValue?, PermValue?, PermValue?, PermValue?, PermValue?, PermValue?, PermValue?, PermValue?, PermValue?, PermValue?, PermValue?)
Initializes a new OverwritePermissions from the current one, changing the provided non-null permissions.
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, 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)
Parameters
createInstantInvite
PermValue?manageChannel
PermValue?addReactions
PermValue?viewChannel
PermValue?sendMessages
PermValue?sendTTSMessages
PermValue?manageMessages
PermValue?embedLinks
PermValue?attachFiles
PermValue?readMessageHistory
PermValue?mentionEveryone
PermValue?useExternalEmojis
PermValue?connect
PermValue?speak
PermValue?muteMembers
PermValue?deafenMembers
PermValue?moveMembers
PermValue?useVoiceActivation
PermValue?manageRoles
PermValue?manageWebhooks
PermValue?prioritySpeaker
PermValue?stream
PermValue?useSlashCommands
PermValue?useApplicationCommands
PermValue?requestToSpeak
PermValue?manageThreads
PermValue?createPublicThreads
PermValue?createPrivateThreads
PermValue?usePublicThreads
PermValue?usePrivateThreads
PermValue?useExternalStickers
PermValue?sendMessagesInThreads
PermValue?startEmbeddedActivities
PermValue?
Returns
ToAllowList()
Creates a List<T> of all the ChannelPermission values that are allowed.
public List<ChannelPermission> ToAllowList()
Returns
- List<ChannelPermission>
A List<T> of all allowed ChannelPermission flags. If none, the list will be empty.
ToDenyList()
Creates a List<T> of all the ChannelPermission values that are denied.
public List<ChannelPermission> ToDenyList()
Returns
- List<ChannelPermission>
A List<T> of all denied ChannelPermission flags. If none, the list will be empty.
ToString()
Returns the fully qualified type name of this instance.
public override string ToString()
Returns
- string
The fully qualified type name.