private static string GetChannelSettings(String channel) { var channelExists = Bot.Clients.ContainsKey(channel); var json = new JavaScriptSerializer().Serialize(new { status = channelExists ? "success" : "not found", channel = new { name = channel }, settings = new { linkBan = ExampleSetting.GetLinkSetting(channel) } }); return(json); }
private static string UpdateChannelSettings(String channel, String postrequest) { var json2 = JObject.Parse(postrequest); var setting2 = json2.SelectToken("settings"); // For now we're just updating linkBan foreach (JProperty VARIABLE in setting2) { switch (VARIABLE.Name) { case "linkBan": ExampleSetting.UpdateLinkSetting(channel, VARIABLE.Value.ToObject <Boolean>()); break; } } var json = GetChannelSettings(channel); return(json); }