2025-08-13 23:32:35 -04:00
|
|
|
using Newtonsoft.Json;
|
|
|
|
|
|
|
|
namespace ConfigPlugin;
|
|
|
|
|
|
|
|
public class Config
|
|
|
|
{
|
|
|
|
public string? CustomMessage;
|
|
|
|
public string? Player;
|
|
|
|
|
|
|
|
public void Write()
|
|
|
|
{
|
|
|
|
File.WriteAllText(ConfigPlugin.ConfigPath, JsonConvert.SerializeObject(this, Formatting.Indented));
|
|
|
|
}
|
|
|
|
|
|
|
|
public static Config? Read()
|
|
|
|
{
|
2025-08-13 23:44:01 -04:00
|
|
|
return !File.Exists(ConfigPlugin.ConfigPath) ? new Config() : JsonConvert.DeserializeObject<Config>(File.ReadAllText(ConfigPlugin.ConfigPath));
|
2025-08-13 23:32:35 -04:00
|
|
|
}
|
|
|
|
}
|