2
0
mirror of synced 2025-02-23 05:28:17 +00:00

Updates bot config to use ids instead of names

This commit is contained in:
Ben 2024-05-16 11:54:31 +02:00
parent 64ae7c8efe
commit 9717591224
No known key found for this signature in database
GPG Key ID: 541B9D8C9F1426A1
3 changed files with 15 additions and 15 deletions

View File

@ -42,7 +42,7 @@ namespace ArgsUniform
{ {
printAppInfo(); printAppInfo();
PrintHelp(); PrintHelp();
throw new Exception(); Environment.Exit(0);
} }
var result = Activator.CreateInstance<T>(); var result = Activator.CreateInstance<T>();
@ -55,9 +55,7 @@ namespace ArgsUniform
{ {
if (!UniformAssign(result, attr, uniformProperty) && attr.Required) if (!UniformAssign(result, attr, uniformProperty) && attr.Required)
{ {
{ missingRequired.Add(uniformProperty);
missingRequired.Add(uniformProperty);
}
} }
} }
} }
@ -75,7 +73,7 @@ namespace ArgsUniform
} }
PrintHelp(); PrintHelp();
throw new ArgumentException("Unable to assemble all required arguments"); Environment.Exit(1);
} }
if (printResult) if (printResult)

View File

@ -7,23 +7,23 @@ namespace BiblioTech
[Uniform("token", "t", "TOKEN", true, "Discord Application Token")] [Uniform("token", "t", "TOKEN", true, "Discord Application Token")]
public string ApplicationToken { get; set; } = string.Empty; public string ApplicationToken { get; set; } = string.Empty;
[Uniform("server-name", "sn", "SERVERNAME", true, "Name of the Discord server")] [Uniform("server-id", "sn", "SERVERID", true, "ID of the Discord server")]
public string ServerName { get; set; } = string.Empty; public ulong ServerId { get; set; }
[Uniform("datapath", "dp", "DATAPATH", false, "Root path where all data files will be saved.")] [Uniform("datapath", "dp", "DATAPATH", false, "Root path where all data files will be saved.")]
public string DataPath { get; set; } = "datapath"; public string DataPath { get; set; } = "datapath";
[Uniform("admin-role", "a", "ADMINROLE", true, "Name of the Discord server admin role")] [Uniform("admin-role-id", "a", "ADMINROLEID", true, "ID of the Discord server admin role")]
public string AdminRoleName { get; set; } = string.Empty; public ulong AdminRoleId { get; set; }
[Uniform("admin-channel-name", "ac", "ADMINCHANNELNAME", true, "Name of the Discord server channel where admin commands are allowed.")] [Uniform("admin-channel-id", "ac", "ADMINCHANNELID", true, "ID of the Discord server channel where admin commands are allowed.")]
public string AdminChannelName { get; set; } = "admin-channel"; public ulong AdminChannelId{ get; set; }
[Uniform("rewards-channel-name", "rc", "REWARDSCHANNELNAME", false, "Name of the Discord server channel where participation rewards will be announced.")] [Uniform("rewards-channel-id", "rc", "REWARDSCHANNELID", false, "ID of the Discord server channel where participation rewards will be announced.")]
public string RewardsChannelName { get; set; } = ""; public ulong RewardsChannelId { get; set; }
[Uniform("chain-events-channel-name", "cc", "CHAINEVENTSCHANNELNAME", false, "Name of the Discord server channel where chain events will be posted.")] [Uniform("chain-events-channel-id", "cc", "CHAINEVENTSCHANNELID", false, "ID of the Discord server channel where chain events will be posted.")]
public string ChainEventsChannelName { get; set; } = ""; public ulong ChainEventsChannelID { get; set; }
[Uniform("reward-api-port", "rp", "REWARDAPIPORT", false, "TCP listen port for the reward API.")] [Uniform("reward-api-port", "rp", "REWARDAPIPORT", false, "TCP listen port for the reward API.")]
public int RewardApiPort { get; set; } = 31080; public int RewardApiPort { get; set; } = 31080;

View File

@ -21,6 +21,8 @@ namespace BiblioTech
public static Task Main(string[] args) public static Task Main(string[] args)
{ {
Log = new ConsoleLog();
var uniformArgs = new ArgsUniform<Configuration>(PrintHelp, args); var uniformArgs = new ArgsUniform<Configuration>(PrintHelp, args);
Config = uniformArgs.Parse(); Config = uniformArgs.Parse();