public DefaultGatewayClient( IOptions <DefaultGatewayClientConfiguration> options, ILogger <DefaultGatewayClient> logger, IGatewayCacheProvider cacheProvider, IGatewayChunker chunker, IGatewayDispatcher dispatcher, IGatewayApiClient apiClient) { Logger = logger; CacheProvider = cacheProvider; CacheProvider.Bind(this); Chunker = chunker; Chunker.Bind(this); Dispatcher = dispatcher; if (apiClient != null) { _apiClient = apiClient; Shards = new Dictionary <ShardId, IGatewayApiClient>(1) { [new ShardId(0, 1)] = apiClient }.ReadOnly(); apiClient.DispatchReceived += Dispatcher.HandleDispatchAsync; } else { Shards = new SynchronizedDictionary <ShardId, IGatewayApiClient>(); } Dispatcher.Bind(this); }
public DefaultGatewayClient( IOptions <DefaultGatewayClientConfiguration> options, ILogger <DefaultGatewayClient> logger, IGatewayCacheProvider cacheProvider, IGatewayChunker chunker, IGatewayDispatcher dispatcher) : this(options, logger, cacheProvider, chunker, dispatcher, null) { // This is the constructor DiscordClientSharder uses. }