2021-11-26 21:10:56 -05:00
|
|
|
namespace PluralKit.Bot;
|
|
|
|
|
|
|
|
public class BotConfig
|
2019-05-08 20:08:56 +02:00
|
|
|
{
|
2021-11-26 21:10:56 -05:00
|
|
|
public static readonly string[] DefaultPrefixes = { "pk;", "pk!" };
|
2020-08-25 19:32:19 +02:00
|
|
|
|
2021-11-26 21:10:56 -05:00
|
|
|
public string Token { get; set; }
|
|
|
|
public ulong? ClientId { get; set; }
|
2021-08-27 11:03:47 -04:00
|
|
|
|
2021-11-26 21:10:56 -05: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 11:03:47 -04:00
|
|
|
|
2021-11-26 21:10:56 -05:00
|
|
|
public int? MaxShardConcurrency { get; set; }
|
2021-08-27 11:03:47 -04:00
|
|
|
|
2021-11-26 21:10:56 -05:00
|
|
|
public ulong? AdminRole { get; set; }
|
2021-08-27 11:03:47 -04:00
|
|
|
|
2021-11-26 21:10:56 -05:00
|
|
|
public ClusterSettings? Cluster { get; set; }
|
2021-08-27 11:03:47 -04:00
|
|
|
|
2021-11-26 21:10:56 -05:00
|
|
|
public string? GatewayQueueUrl { get; set; }
|
2022-01-13 12:26:25 -05:00
|
|
|
public bool UseRedisRatelimiter { get; set; } = false;
|
2022-04-13 08:44:53 -04:00
|
|
|
public bool UseRedisCache { get; set; } = false;
|
2021-06-09 14:49:12 +02:00
|
|
|
|
2022-04-11 15:55:10 -04:00
|
|
|
public string? RedisGatewayUrl { get; set; }
|
|
|
|
|
2021-11-26 21:10:56 -05:00
|
|
|
public string? DiscordBaseUrl { get; set; }
|
2021-11-02 05:36:53 -04:00
|
|
|
|
2021-11-26 21:10:56 -05:00
|
|
|
public bool DisableErrorReporting { get; set; } = false;
|
2021-11-09 01:50:09 -05:00
|
|
|
|
2021-11-27 11:09:08 -05:00
|
|
|
public bool IsBetaBot { get; set; } = false!;
|
|
|
|
public string BetaBotAPIUrl { get; set; }
|
|
|
|
|
2021-11-26 21:10:56 -05:00
|
|
|
public record ClusterSettings
|
|
|
|
{
|
2022-03-11 17:51:04 -05:00
|
|
|
// this is zero-indexed
|
2021-11-26 21:10:56 -05:00
|
|
|
public string NodeName { get; set; }
|
|
|
|
public int TotalShards { get; set; }
|
|
|
|
public int TotalNodes { get; set; }
|
2022-01-07 14:25:08 -05:00
|
|
|
|
|
|
|
// Node name eg. "pluralkit-3", want to extract the 3. blame k8s :p
|
|
|
|
public int NodeIndex => int.Parse(NodeName.Split("-").Last());
|
2019-05-08 20:08:56 +02:00
|
|
|
}
|
|
|
|
}
|