Class ParameterPreconditionAttribute
Requires the parameter to pass the specified precondition before execution can begin.
Assembly: Revolt.Net.Commands.dll​
View Source​
Declaration
public abstract class ParameterPreconditionAttribute : Attribute
Methods​
CheckPermissionsAsync(ICommandContext, ParameterInfo, Object, IServiceProvider)​
Checks whether the condition is met before execution of the command.
View Source​
Declaration
public abstract Task<PreconditionResult> CheckPermissionsAsync(ICommandContext context, ParameterInfo parameter, object value, IServiceProvider services)
Returns​
Task<Revolt.Commands.Results.PreconditionResult>
Parameters​
| Type | Name | Description |
|---|---|---|
| Revolt.Commands.ICommandContext | context | The context of the command. |
| Revolt.Commands.Info.ParameterInfo | parameter | The parameter of the command being checked against. |
System.Object | value | The raw value of the parameter. |
IServiceProvider | services | The service collection used for dependency injection. |