PluralKit/PluralKit.Bot/BotConfig.cs

39 lines
1.2 KiB
C#
Raw Normal View History

namespace PluralKit.Bot;
public class BotConfig
{
public static readonly string[] DefaultPrefixes = { "pk;", "pk!" };
2020-08-25 17:32:19 +00:00
public string Token { get; set; }
public ulong? ClientId { get; set; }
2021-08-27 15:03:47 +00:00
// ASP.NET configuration merges arrays with defaults, so we leave this field nullable
// and fall back to the separate default array at the use site :)
// This does bind [] as null (therefore default) instead of an empty array, but I can live w/ that.
public string[] Prefixes { get; set; }
2021-08-27 15:03:47 +00:00
public int? MaxShardConcurrency { get; set; }
2021-08-27 15:03:47 +00:00
public ulong? AdminRole { get; set; }
2021-08-27 15:03:47 +00:00
public ClusterSettings? Cluster { get; set; }
2021-08-27 15:03:47 +00:00
public string? GatewayQueueUrl { get; set; }
public string? DiscordBaseUrl { get; set; }
public bool DisableErrorReporting { get; set; } = false;
2021-11-27 16:09:08 +00:00
public bool IsBetaBot { get; set; } = false!;
public string BetaBotAPIUrl { get; set; }
public record ClusterSettings
{
public string NodeName { get; set; }
public int TotalShards { get; set; }
public int TotalNodes { get; set; }
// Node name eg. "pluralkit-3", want to extract the 3. blame k8s :p
public int NodeIndex => int.Parse(NodeName.Split("-").Last());
}
}