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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user