示例#1
0
		/// <summary> Initializes a new instance of the DiscordClient class. </summary>
		public DiscordSimpleClient(DiscordSimpleClientConfig config = null)
		{
			_config = config ?? new DiscordSimpleClientConfig();
			_config.Lock();

			_enableVoice = _config.EnableVoice;

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

			_dataSocket = CreateDataSocket();
			if (_enableVoice)
				_voiceSocket = CreateVoiceSocket();
		}
示例#2
0
		internal DiscordSimpleClient(DiscordSimpleClientConfig config = null, string voiceServerId = null)
			: this(config)
		{
			_voiceServerId = voiceServerId;
		}