Show / Hide Table of Contents

Class InteractionFormatter

Inheritance
object
InteractionFormatter
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Discord.Converter
Assembly: Discord.dll
Syntax
public static class InteractionFormatter

Methods

GetEnumFromId<T>(string)

Declaration
public static T GetEnumFromId<T>(string value)
Parameters
Type Name Description
string value
Returns
Type Description
T
Type Parameters
Name Description
T

GetFirstEnumFromId<T>(ref string[])

Declaration
public static T GetFirstEnumFromId<T>(ref string[] values)
Parameters
Type Name Description
string[] values
Returns
Type Description
T
Type Parameters
Name Description
T

GetFirstEnumFromIdAndRemove<T>(ref string[])

Declaration
public static T GetFirstEnumFromIdAndRemove<T>(ref string[] values)
Parameters
Type Name Description
string[] values
Returns
Type Description
T
Type Parameters
Name Description
T

TransformEnumsToId(params Enum[])

Declaration
public static string TransformEnumsToId(params Enum[] enums)
Parameters
Type Name Description
Enum[] enums
Returns
Type Description
string

TransformIdToEnums(string, params Type[])

Transforms the given values to the given enums. CAUTION: The length of the given strings and enums must be the same.

Declaration
public static IEnumerable<Enum> TransformIdToEnums(string value, params Type[] enums)
Parameters
Type Name Description
string value

The list of values separated by comma (e.g. "0,5,3")

Type[] enums

The list of enums that should be given out (e.g. typeof(Enum), typeof(Enum)"/>

Returns
Type Description
IEnumerable<Enum>

A list of converted enums that were passed in.

Exceptions
Type Condition
MismatchedEnumLengthsException

Thrown when the length of enums and values are different.

In This Article
Back to top Generated by DocFX