Table of Contents

Class DiscordPermissionExtensions

Namespace
DSharpPlus.Entities
Assembly
DSharpPlus.dll

Extension methods for DiscordPermission

public static class DiscordPermissionExtensions
Inheritance
DiscordPermissionExtensions

Fields

Length

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

Methods

AsUnderlyingType(DiscordPermission)

Cast a value of DiscordPermission to the underlying type (int). This is mainly a convenience method.

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.

GetValuesAsUnderlyingType()

Retrieves an array of the underlying-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 EnumMemberAttribute 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 EnumMemberAttribute 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>, EnumParseOptions)

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?, EnumParseOptions)

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. Directly equivalent to calling ToString() on value.

ToStringFast(DiscordPermission, SerializationOptions)

Returns the string representation of the DiscordPermission value. Directly equivalent to calling ToString() on value.

ToStringFast(DiscordPermission, bool)

Returns the string representation of the DiscordPermission value. If the member is decorated with the EnumMemberAttribute attribute then that value is returned. Otherwise returns 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, EnumParseOptions)

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(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, EnumParseOptions)

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.