public override bool Initialize(IHandlerConfiguration config) { if (config.TryGetValue("WebhookUrl", out string url) && config.TryGetValue("OutputDir", out string dir)) { WebhookUrl = url; OutputDir = Path.Join(Game.StartupDirectory, dir); client = new DiscordWebhookClient(url); Disabled = false; return(true); } else { throw new ArgumentException("Initialize: needed WebhookUrl and OutputDir to be defined, aborting"); } }
public override bool Initialize(IHandlerConfiguration config) { config.TryGetValue("WebhookUrl", out string WebhookUrl); if (!string.IsNullOrEmpty(WebhookUrl)) { client = new DiscordWebhookClient(WebhookUrl); } if (config.TryGetValue("OutputDir", out string dir)) { OutputDir = Path.Join(global::Hybrasyl.Game.StartupDirectory, dir); Disabled = false; return(true); } else { throw new ArgumentException("Initialize: OutputDir must be defined, aborting"); } }