Add Command and module instance parameters to CheckPermissions

After a small discussion with Joe4evr on discord, a way of retrieving the
state of a module appeared to be needed. The new override should provide
enough context to a bot dev to allow them to do what they want.
This commit is contained in:
Finite Reality
2016-08-04 23:31:21 +01:00
parent 1e72eca34a
commit 11f1163ec2
6 changed files with 9 additions and 9 deletions

View File

@@ -46,14 +46,14 @@ namespace Discord.Commands
{
foreach (PreconditionAttribute precondition in Module.Preconditions)
{
var result = await precondition.CheckPermissions(context).ConfigureAwait(false);
var result = await precondition.CheckPermissions(context, this, Module.Instance).ConfigureAwait(false);
if (!result.IsSuccess)
return result;
}
foreach (PreconditionAttribute precondition in Preconditions)
{
var result = await precondition.CheckPermissions(context).ConfigureAwait(false);
var result = await precondition.CheckPermissions(context, this, Module.Instance).ConfigureAwait(false);
if (!result.IsSuccess)
return result;
}