Пример #1
0
        public DefaultGatewayApiClient(
            IOptions <DefaultGatewayApiClientConfiguration> options,
            ILogger logger,
            Token token,
            IGatewayRateLimiter rateLimiter,
            IGatewayHeartbeater heartbeater,
            IGateway gateway,
            IJsonSerializer serializer)
        {
            var configuration = options.Value;

            Intents        = configuration.Intents;
            LargeThreshold = configuration.LargeThreshold;
            Id             = configuration.Id;
            Presence       = configuration.Presence;
            Logger         = logger;
            Token          = token;
            RateLimiter    = rateLimiter;
            RateLimiter.Bind(this);
            Heartbeater = heartbeater;
            Heartbeater.Bind(this);
            Gateway = gateway;
            Gateway.Bind(this);
            Serializer = serializer;

            _random = new Random();
        }