-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathConfig.cs
More file actions
49 lines (46 loc) · 1.84 KB
/
Config.cs
File metadata and controls
49 lines (46 loc) · 1.84 KB
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
39
40
41
42
43
44
45
46
47
48
49
using dotenv.net;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.IO;
using System.Reflection;
using System.Text;
namespace ArmaforcesMissionBot.DataClasses
{
public class Config
{
public string DiscordToken { get; set; }
public ulong SignupsCategory { get; set; }
public ulong SignupsArchive { get; set; }
public ulong AFGuild { get; set; }
public ulong MissionMakerRole { get; set; }
public ulong SignupRole { get; set; }
public ulong BotRole { get; set; }
public ulong RecruiterRole { get; set; }
public ulong RecruitRole { get; set; }
public string KickImageUrl { get; set; }
public string BanImageUrl { get; set; }
public string ServerManagerUrl { get; set; }
public string ServerManagerApiKey { get; set; }
public string ModsetsApiUrl { get; set; }
public ulong CreateMissionChannel { get; set; }
public ulong PublicContemptChannel { get; set; }
public ulong HallOfShameChannel { get; set; }
public ulong RecruitInfoChannel { get; set; }
public ulong RecruitAskChannel { get; set; }
public ulong RoleMaker { get; set; }
public ulong RoleAssignChannel { get; set; }
public void Load()
{
DotEnv.Config(false);
PropertyInfo[] properties = typeof(Config).GetProperties(BindingFlags.Public | BindingFlags.Instance);
foreach (var prop in properties)
{
if(prop.PropertyType == typeof(string))
prop.SetValue(this, Environment.GetEnvironmentVariable("AF_" + prop.Name));
if (prop.PropertyType == typeof(ulong))
prop.SetValue(this, ulong.Parse(Environment.GetEnvironmentVariable("AF_" + prop.Name)));
}
}
}
}