Table of Contents

Class RuntimeResult

Namespace
Discord.Interactions
Assembly
Discord.Net.Interactions.dll

Represents the base class for creating command result containers.

public abstract class RuntimeResult : IResult
Inheritance
RuntimeResult
Implements
Inherited Members

Constructors

RuntimeResult(InteractionCommandError?, string)

Initializes a new RuntimeResult class with the type of error and reason.

protected RuntimeResult(InteractionCommandError? error, string reason)

Parameters

error InteractionCommandError?

The type of failure, or null if none.

reason string

The reason of failure.

Properties

Error

Gets the error type that may have occurred during the operation.

public 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 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

ToString()

Gets a string that indicates the runtime result.

public override string ToString()

Returns

string

Success if IsSuccess is true; otherwise "Error: ErrorReason".