Browse Source

Change grouping type int -> string

pull/672/head
Joe4evr 8 years ago
parent
commit
47ae826931
2 changed files with 4 additions and 4 deletions
  1. +2
    -2
      src/Discord.Net.Commands/Attributes/PreconditionAttribute.cs
  2. +2
    -2
      src/Discord.Net.Commands/Info/CommandInfo.cs

+ 2
- 2
src/Discord.Net.Commands/Attributes/PreconditionAttribute.cs View File

@@ -8,10 +8,10 @@ namespace Discord.Commands
{
/// <summary>
/// Specify a group that this precondition belongs to. Preconditions of the same group require only one
/// of the preconditions to pass in order to be successful (A || B). Specifying <see cref="Group"/> = 0
/// of the preconditions to pass in order to be successful (A || B). Specifying <see cref="Group"/> = <see cref="null"/>
/// or not at all will require *all* preconditions to pass, just like normal (A &amp;&amp; B).
/// </summary>
public int Group { get; set; } = 0;
public string Group { get; set; } = null;

public abstract Task<PreconditionResult> CheckPermissions(ICommandContext context, CommandInfo command, IServiceProvider services);
}


+ 2
- 2
src/Discord.Net.Commands/Info/CommandInfo.cs View File

@@ -70,9 +70,9 @@ namespace Discord.Commands

async Task<PreconditionGroupResult> CheckGroups(IEnumerable<PreconditionAttribute> preconditions, string type)
{
foreach (IGrouping<int, PreconditionAttribute> preconditionGroup in preconditions.GroupBy(p => p.Group))
foreach (IGrouping<string, PreconditionAttribute> preconditionGroup in preconditions.GroupBy(p => p.Group))
{
if (preconditionGroup.Key == 0)
if (preconditionGroup.Key == null)
{
foreach (PreconditionAttribute precondition in preconditionGroup)
{


Loading…
Cancel
Save