DeukBot4/DeukBot4/Settings.cs

22 lines
521 B
C#

using System.IO;
using Newtonsoft.Json;
namespace DeukBot4
{
public class Settings
{
[JsonProperty]
public string Token { get; private set; }
[JsonProperty]
public string Username { get; private set; }
[JsonProperty]
public ulong OwnerId { get; private set; }
public static Settings FromJsonFile(string filepath)
{
var s = File.ReadAllText(filepath);
return JsonConvert.DeserializeObject<Settings>(s);
}
}
}