DeukBot4/DeukBot4/Settings.cs

24 lines
613 B
C#
Raw Normal View History

2018-03-28 23:34:48 +00:00
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; }
[JsonProperty]
public string DatabaseConnectionString { get; private set; }
2018-03-28 23:34:48 +00:00
public static Settings FromJsonFile(string filepath)
{
var s = File.ReadAllText(filepath);
return JsonConvert.DeserializeObject<Settings>(s);
}
}
}