From 9b6f79a508b352d6c11863f1016b7910ca52702e Mon Sep 17 00:00:00 2001 From: Ske Date: Wed, 29 Apr 2020 00:05:26 +0200 Subject: [PATCH] Factor DiscordConfiguration out into DI --- PluralKit.Bot/Modules.cs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/PluralKit.Bot/Modules.cs b/PluralKit.Bot/Modules.cs index 051c2d78..bd90468e 100644 --- a/PluralKit.Bot/Modules.cs +++ b/PluralKit.Bot/Modules.cs @@ -16,18 +16,15 @@ namespace PluralKit.Bot protected override void Load(ContainerBuilder builder) { // Clients - builder.Register(c => new DiscordShardedClient(new DiscordConfiguration - { - Token = c.Resolve().Token, - TokenType = TokenType.Bot, - MessageCacheSize = 0, - })).AsSelf().SingleInstance(); - builder.Register(c => new DiscordRestClient(new DiscordConfiguration + builder.Register(c => new DiscordConfiguration { Token = c.Resolve().Token, TokenType = TokenType.Bot, MessageCacheSize = 0, - })).AsSelf().SingleInstance(); + LargeThreshold = 50 + }).AsSelf(); + builder.Register(c => new DiscordShardedClient(c.Resolve())).AsSelf().SingleInstance(); + builder.Register(c => new DiscordRestClient(c.Resolve())).AsSelf().SingleInstance(); // Commands builder.RegisterType().AsSelf(); @@ -69,8 +66,7 @@ namespace PluralKit.Bot // Sentry stuff builder.Register(_ => new Scope(null)).AsSelf().InstancePerLifetimeScope(); - - + // Utils builder.Register(c => new HttpClient {