Class ParameterPreconditionAttribute
Requires the parameter to pass the specified precondition before execution can begin.
Assembly: Discord.Net.Commands.dll​
View Source​
Declaration
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = true, Inherited = true)]
public abstract class ParameterPreconditionAttribute : Attribute, _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​
System.Threading.Tasks.Task<Discord.Commands.PreconditionResult>
Parameters​
Type | Name | Description |
---|---|---|
Discord.Commands.ICommandContext | context | The context of the command. |
Discord.Commands.ParameterInfo | parameter | The parameter of the command being checked against. |
System.Object | value | The raw value of the parameter. |
System.IServiceProvider | services | The service collection used for dependency injection. |
Implements​
System.Runtime.InteropServices._Attribute