Skip to main content

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​
TypeNameDescription
Discord.Commands.ICommandContextcontextThe context of the command.
Discord.Commands.ParameterInfoparameterThe parameter of the command being checked against.
System.ObjectvalueThe raw value of the parameter.
System.IServiceProviderservicesThe service collection used for dependency injection.

Implements​

  • System.Runtime.InteropServices._Attribute