/// <summary> Initializes a new instance of the DiscordClient class. </summary>
		public DiscordWSClient(DiscordWSClientConfig config = null)
		{
			_config = config ?? new DiscordWSClientConfig();
			_config.Lock();

			_state = (int)DiscordClientState.Disconnected;
			_cancelToken = new CancellationToken(true);
			_disconnectedEvent = new ManualResetEvent(true);
			_connectedEvent = new ManualResetEventSlim(false);

			_dataSocket = CreateDataSocket();
			if (_config.EnableVoice)
				_voiceSocket = CreateVoiceSocket();
		}
Example #2
0
        /// <summary> Initializes a new instance of the DiscordClient class. </summary>
        public DiscordWSClient(DiscordWSClientConfig config = null)
        {
            _config = config ?? new DiscordWSClientConfig();
            _config.Lock();

            _state             = (int)DiscordClientState.Disconnected;
            _cancelToken       = new CancellationToken(true);
            _disconnectedEvent = new ManualResetEvent(true);
            _connectedEvent    = new ManualResetEventSlim(false);

            _dataSocket = CreateDataSocket();
            if (_config.EnableVoice)
            {
                _voiceSocket = CreateVoiceSocket();
            }
        }
		internal DiscordWSClient(DiscordWSClientConfig config = null, string voiceServerId = null)
			: this(config)
		{
			_voiceServerId = voiceServerId;
		}
Example #4
0
 internal DiscordWSClient(DiscordWSClientConfig config = null, string voiceServerId = null)
     : this(config)
 {
     _voiceServerId = voiceServerId;
 }