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
Methods
FromError(IResult)
Returns a PreconditionGroupResult with the specified result
type.
public static PreconditionGroupResult FromError(IResult result)
Parameters
result
IResultThe result of failure.
Returns
FromError(Exception)
Returns a PreconditionGroupResult with Exception and the Message.
public static PreconditionGroupResult FromError(Exception exception)
Parameters
exception
ExceptionThe exception that caused the precondition check to fail.
Returns
FromError(string, IEnumerable<PreconditionResult>)
Returns a PreconditionGroupResult with UnmetPrecondition and the specified reason.
public static PreconditionGroupResult FromError(string reason, IEnumerable<PreconditionResult> results)
Parameters
reason
stringThe reason of failure.
results
IEnumerable<PreconditionResult>Precondition results of this group
Returns
FromSuccess()
Returns a PreconditionGroupResult with no errors.
public static PreconditionGroupResult FromSuccess()