diff --git a/src/Discord.Net.Commands/CommandService.cs b/src/Discord.Net.Commands/CommandService.cs index 2c7955028..cc60f7c18 100644 --- a/src/Discord.Net.Commands/CommandService.cs +++ b/src/Discord.Net.Commands/CommandService.cs @@ -73,7 +73,7 @@ namespace Discord.Commands _moduleLock.Release(); } } - public async Task AddModuleAsync() + public async Task AddModuleAsync() where T : ModuleBase { await _moduleLock.WaitAsync().ConfigureAwait(false); try @@ -86,7 +86,7 @@ namespace Discord.Commands var module = ModuleClassBuilder.Build(this, typeInfo).FirstOrDefault(); if (module.Value == default(ModuleInfo)) - throw new InvalidOperationException($"Could not build the module {typeof(T).FullName}, did you pass an invalid type?"); + throw new InvalidOperationException($"Could not build the module {typeof(T).FullName}"); _typedModuleDefs[module.Key] = module.Value; @@ -143,7 +143,7 @@ namespace Discord.Commands _moduleLock.Release(); } } - public async Task RemoveModuleAsync() + public async Task RemoveModuleAsync() where T : ModuleBase { await _moduleLock.WaitAsync().ConfigureAwait(false); try