mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-04 04:56:49 +00:00
Add config option for max shard concurrency
This commit is contained in:
parent
2039a34c16
commit
13e3289c26
4 changed files with 27 additions and 11 deletions
|
|
@ -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>()))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue