Table of Contents

Struct ParseResult

Namespace
Discord.Interactions
Assembly
Discord.Net.Interactions.dll
public struct ParseResult : IResult
Implements
Inherited Members

Properties

Args

public readonly object[] Args { get; }

Property Value

object[]

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

bool

true if the result is positive; otherwise false.

Methods

FromError(IResult)

public static ParseResult FromError(IResult result)

Parameters

result IResult

Returns

ParseResult

FromError(InteractionCommandError, string)

public static ParseResult FromError(InteractionCommandError error, string reason)

Parameters

error InteractionCommandError
reason string

Returns

ParseResult

FromError(Exception)

public static ParseResult FromError(Exception exception)

Parameters

exception Exception

Returns

ParseResult

FromSuccess(object[])

public static ParseResult FromSuccess(object[] args)

Parameters

args object[]

Returns

ParseResult

ToString()

Returns the fully qualified type name of this instance.

public override string ToString()

Returns

string

The fully qualified type name.