public long GetSelectedWebhook() { if (WebHookDB.IDExists(Settings.CurrentWebHook)) { return(Settings.CurrentWebHook); } if (WebHookDB.HasEntries()) { return(WebHookDB.GetWebHooks().Min(wh => wh.ID)); } return(WebHookDB.GetWebHooks().First().ID); }
public void SetSelectedWebhook(long id) { if (!WebHookDB.IDExists(id)) { return; } Settings.CurrentWebHook = id; var mainSettings = new Settings(); mainSettings.CurrentWebHook = id; mainSettings.Save(); }
public List <WebHook> GetWebHooks() { return(WebHookDB.GetWebHooks()); }