2022-04-23 20:01:27 +00:00
|
|
|
|
using RegexBot.Common;
|
|
|
|
|
|
|
|
|
|
namespace RegexBot.Modules.PendingOutRole;
|
|
|
|
|
class ModuleConfig {
|
|
|
|
|
public EntityName Role { get; }
|
|
|
|
|
|
|
|
|
|
public ModuleConfig(JObject conf) {
|
2022-08-23 02:25:48 +00:00
|
|
|
|
try {
|
|
|
|
|
Role = new EntityName(conf[nameof(Role)]?.Value<string>()!, EntityType.Role);
|
|
|
|
|
} catch (ArgumentException) {
|
|
|
|
|
throw new ModuleLoadException("Role was not properly specified.");
|
|
|
|
|
} catch (FormatException) {
|
|
|
|
|
throw new ModuleLoadException("Name specified in configuration is not a role.");
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-23 20:01:27 +00:00
|
|
|
|
}
|
|
|
|
|
}
|