Add IDependencyMap to parameter preconditions
This commit is contained in:
@@ -6,6 +6,6 @@ namespace Discord.Commands
|
|||||||
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = true, Inherited = true)]
|
[AttributeUsage(AttributeTargets.Parameter, AllowMultiple = true, Inherited = true)]
|
||||||
public abstract class ParameterPreconditionAttribute : Attribute
|
public abstract class ParameterPreconditionAttribute : Attribute
|
||||||
{
|
{
|
||||||
public abstract Task<PreconditionResult> CheckPermissions(CommandContext context, ParameterInfo parameter, object value);
|
public abstract Task<PreconditionResult> CheckPermissions(CommandContext context, ParameterInfo parameter, object value, IDependencyMap map);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -53,7 +53,7 @@ namespace Discord.Commands
|
|||||||
|
|
||||||
foreach (var precondition in Preconditions)
|
foreach (var precondition in Preconditions)
|
||||||
{
|
{
|
||||||
var result = await precondition.CheckPermissions(context, this, args[position]).ConfigureAwait(false);
|
var result = await precondition.CheckPermissions(context, this, args[position], map).ConfigureAwait(false);
|
||||||
if (!result.IsSuccess)
|
if (!result.IsSuccess)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user