Adds reward api port to bot config

This commit is contained in:
benbierens 2024-02-01 17:02:10 -05:00
parent 7d33c1c113
commit dd5baeda46
No known key found for this signature in database
GPG Key ID: FE44815D96D0A1AA
2 changed files with 6 additions and 2 deletions

View File

@ -19,9 +19,11 @@ namespace BiblioTech
[Uniform("admin-channel-name", "ac", "ADMINCHANNELNAME", true, "Name of the Discord server channel where admin commands are allowed.")]
public string AdminChannelName { get; set; } = "admin-channel";
[Uniform("rewards-channel-name", "ac", "REWARDSCHANNELNAME", false, "Name of the Discord server channel where participation rewards will be announced.")]
[Uniform("rewards-channel-name", "rc", "REWARDSCHANNELNAME", false, "Name of the Discord server channel where participation rewards will be announced.")]
public string RewardsChannelName { get; set; } = "";
[Uniform("reward-api-port", "rp", "REWARDAPIPORT", false, "TCP listen port for the reward API.")]
public int RewardApiPort { get; set; } = 31080;
public string EndpointsPath
{

View File

@ -25,9 +25,11 @@ namespace BiblioTech.Rewards
public void Start()
{
cts = new CancellationTokenSource();
listener.Prefixes.Add($"http://*:31080/");
var uri = $"http://*:{Program.Config.RewardApiPort}/";
listener.Prefixes.Add(uri);
listener.Start();
taskFactory.Run(ConnectionDispatcher, nameof(ConnectionDispatcher));
Program.Log.Log($"Reward API listening on '{uri}'");
}
public void Stop()