Merge pull request #522 from RogueException/feature/idiot-repellent
Throw an InvalidOp if a user tries to set the DefaultRunMode to Default
This commit is contained in:
@@ -35,6 +35,8 @@ namespace Discord.Commands
|
||||
_caseSensitive = config.CaseSensitiveCommands;
|
||||
_separatorChar = config.SeparatorChar;
|
||||
_defaultRunMode = config.DefaultRunMode;
|
||||
if (_defaultRunMode == RunMode.Default)
|
||||
throw new InvalidOperationException("The default run mode cannot be set to Default, it must be one of Sync, Mixed, or Async");
|
||||
|
||||
_moduleLock = new SemaphoreSlim(1, 1);
|
||||
_typedModuleDefs = new ConcurrentDictionary<Type, ModuleInfo>();
|
||||
|
||||
Reference in New Issue
Block a user