From b3590165d06bafa0fe1a27a2c8fc5a498e0c95d3 Mon Sep 17 00:00:00 2001 From: MarkusGordathian Date: Sat, 18 Mar 2017 10:21:07 -0700 Subject: [PATCH] Pluralized name and used .Cast() --- src/Discord.Net.Commands/Info/CommandInfo.cs | 4 ++-- src/Discord.Net.Commands/Info/ModuleInfo.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Discord.Net.Commands/Info/CommandInfo.cs b/src/Discord.Net.Commands/Info/CommandInfo.cs index 27cd58d5f..55231b47a 100644 --- a/src/Discord.Net.Commands/Info/CommandInfo.cs +++ b/src/Discord.Net.Commands/Info/CommandInfo.cs @@ -63,8 +63,8 @@ namespace Discord.Commands _action = builder.Callback; } - public IEnumerable GetPrecondition() where TPrecondition : PreconditionAttribute => - Preconditions.Where(x => x.GetType() == typeof(TPrecondition)).Select(x => x as TPrecondition); + public IEnumerable GetPreconditions() where TPrecondition : PreconditionAttribute => + Preconditions.Where(x => x.GetType() == typeof(TPrecondition)).Cast(); public async Task CheckPreconditionsAsync(ICommandContext context, IDependencyMap map = null) { diff --git a/src/Discord.Net.Commands/Info/ModuleInfo.cs b/src/Discord.Net.Commands/Info/ModuleInfo.cs index 43bcd8e21..ed385564e 100644 --- a/src/Discord.Net.Commands/Info/ModuleInfo.cs +++ b/src/Discord.Net.Commands/Info/ModuleInfo.cs @@ -20,8 +20,8 @@ namespace Discord.Commands public ModuleInfo Parent { get; } public bool IsSubmodule => Parent != null; - public IEnumerable GetPrecondition() where TPrecondition : PreconditionAttribute => - Preconditions.Where(x => x.GetType() == typeof(TPrecondition)).Select(x => x as TPrecondition); + public IEnumerable GetPreconditions() where TPrecondition : PreconditionAttribute => + Preconditions.Where(x => x.GetType() == typeof(TPrecondition)).Cast(); internal ModuleInfo(ModuleBuilder builder, CommandService service, ModuleInfo parent = null) {