Table of Contents

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 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

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

allowValue string
denyValue string

OverwritePermissions(ulong, ulong)

Creates a new OverwritePermissions with the provided allow and deny packed values.

public OverwritePermissions(ulong allowValue, ulong denyValue)

Parameters

allowValue ulong
denyValue ulong

Properties

AddReactions

If Allowed, a user may add reactions.

public PermValue AddReactions { get; }

Property Value

PermValue

AllowValue

Gets a packed value representing all the allowed permissions in this OverwritePermissions.

public readonly ulong AllowValue { get; }

Property Value

ulong

AttachFiles

If Allowed, a user may send files.

public PermValue AttachFiles { get; }

Property Value

PermValue

Connect

If Allowed, a user may connect to a voice channel.

public PermValue Connect { get; }

Property Value

PermValue

CreateInstantInvite

If Allowed, a user may create invites.

public PermValue CreateInstantInvite { get; }

Property Value

PermValue

CreatePrivateThreads

If true, a user may create private threads in this guild.

public PermValue CreatePrivateThreads { get; }

Property Value

PermValue

CreatePublicThreads

If true, a user may create public threads in this guild.

public PermValue CreatePublicThreads { get; }

Property Value

PermValue

DeafenMembers

If Allowed, a user may deafen users.

public PermValue DeafenMembers { get; }

Property Value

PermValue

DenyValue

Gets a packed value representing all the denied permissions in this OverwritePermissions.

public readonly ulong DenyValue { get; }

Property Value

ulong

If Allowed, Discord will auto-embed links sent by this user.

public PermValue EmbedLinks { get; }

Property Value

PermValue

InheritAll

Gets a blank OverwritePermissions that inherits all permissions.

public static OverwritePermissions InheritAll { get; }

Property Value

OverwritePermissions

ManageChannel

If Allowed, a user may create, delete and modify this channel.

public PermValue ManageChannel { get; }

Property Value

PermValue

ManageMessages

If Allowed, a user may delete messages.

public PermValue ManageMessages { get; }

Property Value

PermValue

ManageRoles

If Allowed, a user may adjust role permissions. This also implicitly grants all other permissions.

public PermValue ManageRoles { get; }

Property Value

PermValue

ManageThreads

If true, a user may manage threads in this guild.

public PermValue ManageThreads { get; }

Property Value

PermValue

ManageWebhooks

If True, a user may edit the webhooks for this channel.

public PermValue ManageWebhooks { get; }

Property Value

PermValue

MentionEveryone

If Allowed, a user may mention @everyone.

public PermValue MentionEveryone { get; }

Property Value

PermValue

MoveMembers

If Allowed, a user may move other users between voice channels.

public PermValue MoveMembers { get; }

Property Value

PermValue

MuteMembers

If Allowed, a user may mute users.

public PermValue MuteMembers { get; }

Property Value

PermValue

PrioritySpeaker

If Allowed, a user may use priority speaker in a voice channel.

public PermValue PrioritySpeaker { get; }

Property Value

PermValue

ReadMessageHistory

If Allowed, a user may read previous messages.

public PermValue ReadMessageHistory { get; }

Property Value

PermValue

RequestToSpeak

If true, a user may request to speak in stage channels.

public PermValue RequestToSpeak { get; }

Property Value

PermValue

SendMessages

If Allowed, a user may send messages.

public PermValue SendMessages { get; }

Property Value

PermValue

SendMessagesInThreads

If true, a user may send messages in threads in this guild.

public PermValue SendMessagesInThreads { get; }

Property Value

PermValue

SendTTSMessages

If Allowed, a user may send text-to-speech messages.

public PermValue SendTTSMessages { get; }

Property Value

PermValue

Speak

If Allowed, a user may speak in a voice channel.

public PermValue Speak { get; }

Property Value

PermValue

StartEmbeddedActivities

If true, a user launch application activities in voice channels in this guild.

public PermValue StartEmbeddedActivities { get; }

Property Value

PermValue

Stream

If Allowed, a user may go live in a voice channel.

public PermValue Stream { get; }

Property Value

PermValue

UseApplicationCommands

If true, a user may use slash commands in this guild.

public PermValue UseApplicationCommands { get; }

Property Value

PermValue

UseExternalEmojis

If Allowed, a user may use custom emoji from other guilds.

public PermValue UseExternalEmojis { get; }

Property Value

PermValue

UseExternalStickers

If true, a user may use external stickers in this guild.

public PermValue UseExternalStickers { get; }

Property Value

PermValue

UseVAD

If Allowed, a user may use voice-activity-detection rather than push-to-talk.

public PermValue UseVAD { get; }

Property Value

PermValue

ViewChannel

If Allowed, a user may join channels.

public PermValue ViewChannel { get; }

Property Value

PermValue

Methods

AllowAll(IChannel)

Gets a OverwritePermissions that grants all permissions for the given channel.

public static OverwritePermissions AllowAll(IChannel channel)

Parameters

channel IChannel

Returns

OverwritePermissions

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

OverwritePermissions

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

OverwritePermissions

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.