@@ -73,7 +73,7 @@ namespace Discord.Commands | |||||
_moduleLock.Release(); | _moduleLock.Release(); | ||||
} | } | ||||
} | } | ||||
public async Task<ModuleInfo> AddModuleAsync<T>() where T : IModuleBase | |||||
public async Task<ModuleInfo> AddModuleAsync<T>() where T : IModuleBase<ICommandContext> | |||||
{ | { | ||||
await _moduleLock.WaitAsync().ConfigureAwait(false); | await _moduleLock.WaitAsync().ConfigureAwait(false); | ||||
try | try | ||||
@@ -143,7 +143,7 @@ namespace Discord.Commands | |||||
_moduleLock.Release(); | _moduleLock.Release(); | ||||
} | } | ||||
} | } | ||||
public async Task<bool> RemoveModuleAsync<T>() where T : IModuleBase | |||||
public async Task<bool> RemoveModuleAsync<T>() where T : IModuleBase<ICommandContext> | |||||
{ | { | ||||
await _moduleLock.WaitAsync().ConfigureAwait(false); | await _moduleLock.WaitAsync().ConfigureAwait(false); | ||||
try | try | ||||
@@ -1,5 +1,10 @@ | |||||
namespace Discord.Commands | |||||
namespace Discord.Commands | |||||
{ | { | ||||
public interface IModuleBase<out T> | |||||
where T : ICommandContext | |||||
{ | |||||
} | |||||
internal interface IModuleBase | internal interface IModuleBase | ||||
{ | { | ||||
void SetContext(ICommandContext context); | void SetContext(ICommandContext context); | ||||
@@ -5,7 +5,7 @@ namespace Discord.Commands | |||||
{ | { | ||||
public abstract class ModuleBase : ModuleBase<CommandContext> { } | public abstract class ModuleBase : ModuleBase<CommandContext> { } | ||||
public abstract class ModuleBase<T> : IModuleBase | |||||
public abstract class ModuleBase<T> : IModuleBase, IModuleBase<T> | |||||
where T : class, ICommandContext | where T : class, ICommandContext | ||||
{ | { | ||||
public T Context { get; private set; } | public T Context { get; private set; } | ||||