Noi
1149f2800d
Moved modules into the assembly itself to simplify development of further features and reduce complexity in building this project. Additionally, many small adjustments were made, including: - Add documentation to most public methods that had it missing - Minor style updates - Updated readme to reflect near-completion of this rewrite - Remove any last remaining references to old project name Kerobot - Update dependencies
15 lines
528 B
C#
15 lines
528 B
C#
using RegexBot.Common;
|
|
|
|
namespace RegexBot.Modules.PendingOutRole;
|
|
class ModuleConfig {
|
|
public EntityName Role { get; }
|
|
|
|
public ModuleConfig(JObject conf) {
|
|
var cfgRole = conf[nameof(Role)]?.Value<string>();
|
|
if (string.IsNullOrWhiteSpace(cfgRole))
|
|
throw new ModuleLoadException("Role was not specified.");
|
|
Role = new EntityName(cfgRole);
|
|
if (Role.Type != EntityType.Role)
|
|
throw new ModuleLoadException("Name specified in configuration is not a role.");
|
|
}
|
|
}
|