From 47ae82693128904ce56b8e0f878f4ba69b0dd2b9 Mon Sep 17 00:00:00 2001 From: Joe4evr Date: Mon, 19 Jun 2017 20:39:17 +0200 Subject: [PATCH] Change grouping type int -> string --- src/Discord.Net.Commands/Attributes/PreconditionAttribute.cs | 4 ++-- src/Discord.Net.Commands/Info/CommandInfo.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Discord.Net.Commands/Attributes/PreconditionAttribute.cs b/src/Discord.Net.Commands/Attributes/PreconditionAttribute.cs index 87be459d2..3727510d9 100644 --- a/src/Discord.Net.Commands/Attributes/PreconditionAttribute.cs +++ b/src/Discord.Net.Commands/Attributes/PreconditionAttribute.cs @@ -8,10 +8,10 @@ namespace Discord.Commands { /// /// 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 = 0 + /// of the preconditions to pass in order to be successful (A || B). Specifying = /// or not at all will require *all* preconditions to pass, just like normal (A && B). /// - public int Group { get; set; } = 0; + public string Group { get; set; } = null; public abstract Task CheckPermissions(ICommandContext context, CommandInfo command, IServiceProvider services); } diff --git a/src/Discord.Net.Commands/Info/CommandInfo.cs b/src/Discord.Net.Commands/Info/CommandInfo.cs index 323450bcc..716d562f1 100644 --- a/src/Discord.Net.Commands/Info/CommandInfo.cs +++ b/src/Discord.Net.Commands/Info/CommandInfo.cs @@ -70,9 +70,9 @@ namespace Discord.Commands async Task CheckGroups(IEnumerable preconditions, string type) { - foreach (IGrouping preconditionGroup in preconditions.GroupBy(p => p.Group)) + foreach (IGrouping preconditionGroup in preconditions.GroupBy(p => p.Group)) { - if (preconditionGroup.Key == 0) + if (preconditionGroup.Key == null) { foreach (PreconditionAttribute precondition in preconditionGroup) {