Struct TypeConverterResult
- Namespace
- Discord.Interactions
- Assembly
- Discord.Net.Interactions.dll
Represents a result type for ReadAsync(IInteractionContext, IApplicationCommandInteractionDataOption, IServiceProvider).
public struct TypeConverterResult : IResult
- Implements
- Inherited Members
Properties
Error
Gets the error type that may have occurred during the operation.
public readonly InteractionCommandError? Error { get; }
Property Value
- InteractionCommandError?
A InteractionCommandError indicating the type of error that may have occurred during the operation; null if the operation was successful.
ErrorReason
Gets the reason for the error.
public readonly string ErrorReason { get; }
Property Value
- string
A string containing the error reason.
IsSuccess
Indicates whether the operation was successful or not.
public bool IsSuccess { get; }
Property Value
Value
Gets the result of the conversion if the operation was successful.
public readonly object Value { get; }
Property Value
Methods
FromError(IResult)
Returns a PreconditionResult with the specified result
type.
public static TypeConverterResult FromError(IResult result)
Parameters
result
IResultThe result of failure.
Returns
FromError(InteractionCommandError, string)
Returns a PreconditionResult with the specified error and the reason.
public static TypeConverterResult FromError(InteractionCommandError error, string reason)
Parameters
error
InteractionCommandErrorThe type of error.
reason
stringThe reason of failure.
Returns
FromError(Exception)
Returns a TypeConverterResult with Exception and the Message.
public static TypeConverterResult FromError(Exception exception)
Parameters
exception
ExceptionThe exception that caused the type conversion to fail.
Returns
FromSuccess(object)
Returns a TypeConverterResult with no errors.
public static TypeConverterResult FromSuccess(object value)
Parameters
value
object
Returns
ToString()
Returns the fully qualified type name of this instance.
public override string ToString()
Returns
- string
The fully qualified type name.