-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfig.cs
More file actions
38 lines (31 loc) · 1013 Bytes
/
Config.cs
File metadata and controls
38 lines (31 loc) · 1013 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
using Newtonsoft.Json;
namespace slopbot;
public class Config
{
public static Config Get()
{
var path = Path.Combine(Directory.GetCurrentDirectory(), "config.json");
var text = File.ReadAllText(path);
Config config = JsonConvert.DeserializeObject<Config>(text) ?? new Config();
return config;
}
public string? Token { set; get; }
public string? Url { set; get; }
public string? Type { set; get; }
public string? Cw { set; get; }
public int? Timer { set; get; }
public string[]? ExcludedVisibilities { set; get; }
public string[]? AccountsToScrape { set; get; }
public ConfigExclusionRules? ExcludedCws { set; get; }
public ConfigExclusionRules? ExcludedText { set; get; }
public ConfigSources? Sources { set; get; }
}
public class ConfigExclusionRules
{
public string[]? Contains { set; get; }
public string[]? Equals { set; get; }
}
public class ConfigSources
{
public string[]? MisskeyExport { set; get; }
}