Table of Contents

Class DiscordPermissionExtensions

Namespace
DSharpPlus.Entities
Assembly
DSharpPlus.dll

Extension methods for DiscordPermission

public static class DiscordPermissionExtensions
Inheritance
object
DiscordPermissionExtensions

Fields

Length

The number of members in the enum. This is a non-distinct count of defined names.

Methods

GetNames()

Retrieves an array of the names of the members defined in DiscordPermission. Note that this returns a new array with every invocation, so should be cached if appropriate.

GetValues()

Retrieves an array of the values of the members defined in DiscordPermission. Note that this returns a new array with every invocation, so should be cached if appropriate.

IsDefined(DiscordPermission)

Returns a boolean telling whether the given enum value exists in the enumeration.

IsDefined(in ReadOnlySpan<char>)

Returns a boolean telling whether an enum with the given name exists in the enumeration

IsDefined(in ReadOnlySpan<char>, bool)

Returns a boolean telling whether an enum with the given name exists in the enumeration, or optionally if a member decorated with a [Display] attribute with the required name exists. Slower then the IsDefined(string, bool) overload, but doesn't allocate memory./>

IsDefined(string)

Returns a boolean telling whether an enum with the given name exists in the enumeration.

IsDefined(string, bool)

Returns a boolean telling whether an enum with the given name exists in the enumeration, or if a member decorated with a [Display] attribute with the required name exists.

Parse(in ReadOnlySpan<char>)

Converts the string representation of the name or numeric value of an DiscordPermission to the equivalent instance.

Parse(in ReadOnlySpan<char>, bool)

Converts the string representation of the name or numeric value of an DiscordPermission to the equivalent instance.

Parse(in ReadOnlySpan<char>, bool, bool)

Converts the string representation of the name or numeric value of an DiscordPermission to the equivalent instance.

Parse(string?)

Converts the string representation of the name or numeric value of an DiscordPermission to the equivalent instance.

Parse(string?, bool)

Converts the string representation of the name or numeric value of an DiscordPermission to the equivalent instance.

Parse(string?, bool, bool)

Converts the string representation of the name or numeric value of an DiscordPermission to the equivalent instance.

ToStringFast(DiscordPermission)

Returns the string representation of the DiscordPermission value. If the attribute is decorated with a [Display] attribute, then uses the provided value. Otherwise uses the name of the member, equivalent to calling ToString() on value.

TryParse(in ReadOnlySpan<char>, out DiscordPermission)

Converts the span representation of the name or numeric value of an DiscordPermission to the equivalent instance. The return value indicates whether the conversion succeeded.

TryParse(in ReadOnlySpan<char>, out DiscordPermission, bool)

Converts the span representation of the name or numeric value of an DiscordPermission to the equivalent instance. The return value indicates whether the conversion succeeded.

TryParse(in ReadOnlySpan<char>, out DiscordPermission, bool, bool)

Converts the span representation of the name or numeric value of an DiscordPermission to the equivalent instance. The return value indicates whether the conversion succeeded.

TryParse(string?, out DiscordPermission)

Converts the string representation of the name or numeric value of an DiscordPermission to the equivalent instance. The return value indicates whether the conversion succeeded.

TryParse(string?, out DiscordPermission, bool)

Converts the string representation of the name or numeric value of an DiscordPermission to the equivalent instance. The return value indicates whether the conversion succeeded.

TryParse(string?, out DiscordPermission, bool, bool)

Converts the string representation of the name or numeric value of an DiscordPermission to the equivalent instance. The return value indicates whether the conversion succeeded.