Throw an InvalidOp if a user tries to set the DefaultRunMode to Default

never overestimate the end user
This commit is contained in:
Christopher F
2017-02-12 19:06:36 -05:00
parent 70e8cea6e2
commit f3aa546407

View File

@@ -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>();