Removed the aforementioned garbage

This commit is contained in:
TheUbMunster 2023-06-27 21:34:45 -06:00
parent 67a00716f8
commit 5b4de5ff8b
2 changed files with 1 additions and 36 deletions

View File

@ -1,34 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json;
using Newtonsoft;
namespace Server.LegacyJsonSupport
{
public class LogToAdminJsonConverter : JsonConverter<string>
{
public override string? ReadJson(JsonReader reader, Type objectType, string? existingValue, bool hasExistingValue, JsonSerializer serializer)
{
//JToken t = JToken.Load(reader);
if (reader.TokenType != JsonToken.String)
return null;
//JObject j = JObject.Load(reader);
//string? k = reader.ReadAsString();
//if (k == "LogChannel" || k == "AdminChannel")
return hasExistingValue ? existingValue : (string?)reader.Value;
//else
// return null;
}
public override void WriteJson(JsonWriter writer, string? value, JsonSerializer serializer)
{
//writer.
//writer.WritePropertyName("AdminChannel");
writer.WriteValue(value);
}
}
}

View File

@ -75,8 +75,7 @@ public class Settings {
public string? Token { get; set; }
public string Prefix { get; set; } = "$";
public string? CommandChannel { get; set; }
[JsonProperty(PropertyName = "AdminChannel")]
[JsonConverter(typeof(LogToAdminJsonConverter))]
[JsonProperty(PropertyName = "LogChannel")]
public string? AdminChannel { get; set; }
public bool LogCommands { get; set; } = false;
public bool FilterOutNonIssueWarnings { get; set; } = true;