PreconditionGroup quick fix
It didn't make much sense
This commit is contained in:
@@ -68,7 +68,7 @@ namespace Discord.Commands
|
|||||||
{
|
{
|
||||||
services = services ?? EmptyServiceProvider.Instance;
|
services = services ?? EmptyServiceProvider.Instance;
|
||||||
|
|
||||||
async Task<PreconditionGroupResult> CheckGroups(IEnumerable<PreconditionAttribute> preconditions, string type)
|
async Task<PreconditionResult> CheckGroups(IEnumerable<PreconditionAttribute> preconditions, string type)
|
||||||
{
|
{
|
||||||
foreach (IGrouping<string, PreconditionAttribute> preconditionGroup in preconditions.GroupBy(p => p.Group, StringComparer.Ordinal))
|
foreach (IGrouping<string, PreconditionAttribute> preconditionGroup in preconditions.GroupBy(p => p.Group, StringComparer.Ordinal))
|
||||||
{
|
{
|
||||||
@@ -78,7 +78,7 @@ namespace Discord.Commands
|
|||||||
{
|
{
|
||||||
var result = await precondition.CheckPermissions(context, this, services).ConfigureAwait(false);
|
var result = await precondition.CheckPermissions(context, this, services).ConfigureAwait(false);
|
||||||
if (!result.IsSuccess)
|
if (!result.IsSuccess)
|
||||||
return PreconditionGroupResult.FromError($"{type} default precondition group failed.", new[] { result });
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -243,4 +243,4 @@ namespace Discord.Commands
|
|||||||
return $"\"{Name}\" for {context.User} in {context.Channel}";
|
return $"\"{Name}\" for {context.User} in {context.Channel}";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user