DeukBot4/DeukBot4/Settings.cs

32 lines
962 B
C#
Raw Normal View History

2019-01-31 10:52:08 +00:00
using System.Collections.Generic;
2018-04-03 12:40:24 +00:00
using System.IO;
using DeukBot4.MessageHandlers;
2018-03-28 23:34:48 +00:00
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-04-03 12:40:24 +00:00
[JsonProperty]
public List<ServerChannelIDs> BackupChannels { get; private set; }
[JsonProperty]
public ImageBackupHandler.WebDavSettings WebDavSettings { get; private set; }
2018-05-18 11:36:06 +00:00
[JsonProperty]
public ulong DmChannel { 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);
}
}
}