Add config option for max shard concurrency
This commit is contained in:
@@ -11,5 +11,7 @@ namespace PluralKit.Bot
|
||||
// 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; }
|
||||
|
||||
public int? MaxShardConcurrency { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -21,16 +21,21 @@ namespace PluralKit.Bot
|
||||
protected override void Load(ContainerBuilder builder)
|
||||
{
|
||||
// Clients
|
||||
builder.Register(c => new GatewaySettings
|
||||
builder.Register(c =>
|
||||
{
|
||||
Token = c.Resolve<BotConfig>().Token,
|
||||
Intents = GatewayIntent.Guilds |
|
||||
GatewayIntent.DirectMessages |
|
||||
GatewayIntent.DirectMessageReactions |
|
||||
GatewayIntent.GuildEmojis |
|
||||
GatewayIntent.GuildMessages |
|
||||
GatewayIntent.GuildWebhooks |
|
||||
GatewayIntent.GuildMessageReactions
|
||||
var botConfig = c.Resolve<BotConfig>();
|
||||
return new GatewaySettings
|
||||
{
|
||||
Token = botConfig.Token,
|
||||
MaxShardConcurrency = botConfig.MaxShardConcurrency,
|
||||
Intents = GatewayIntent.Guilds |
|
||||
GatewayIntent.DirectMessages |
|
||||
GatewayIntent.DirectMessageReactions |
|
||||
GatewayIntent.GuildEmojis |
|
||||
GatewayIntent.GuildMessages |
|
||||
GatewayIntent.GuildWebhooks |
|
||||
GatewayIntent.GuildMessageReactions
|
||||
};
|
||||
}).AsSelf().SingleInstance();
|
||||
builder.RegisterType<Cluster>().AsSelf().SingleInstance();
|
||||
builder.Register(c => new Myriad.Rest.DiscordApiClient(c.Resolve<BotConfig>().Token, c.Resolve<ILogger>()))
|
||||
|
||||
Reference in New Issue
Block a user