Table of Contents

Class PreconditionGroupResult

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

Represents a result type for grouped command preconditions.

public class PreconditionGroupResult : PreconditionResult, IResult
Inheritance
PreconditionGroupResult
Implements
Inherited Members

Properties

Results

Gets the results of the preconditions of this group.

public IReadOnlyCollection<PreconditionResult> Results { get; }

Property Value

IReadOnlyCollection<PreconditionResult>

Methods

FromError(IResult)

Returns a PreconditionGroupResult with the specified result type.

public static PreconditionGroupResult FromError(IResult result)

Parameters

result IResult

The result of failure.

Returns

PreconditionGroupResult

FromError(Exception)

Returns a PreconditionGroupResult with Exception and the Message.

public static PreconditionGroupResult FromError(Exception exception)

Parameters

exception Exception

The exception that caused the precondition check to fail.

Returns

PreconditionGroupResult

FromError(string, IEnumerable<PreconditionResult>)

Returns a PreconditionGroupResult with UnmetPrecondition and the specified reason.

public static PreconditionGroupResult FromError(string reason, IEnumerable<PreconditionResult> results)

Parameters

reason string

The reason of failure.

results IEnumerable<PreconditionResult>

Precondition results of this group

Returns

PreconditionGroupResult

FromSuccess()

Returns a PreconditionGroupResult with no errors.

public static PreconditionGroupResult FromSuccess()

Returns

PreconditionGroupResult