fix: don't raise REST log events twice

The DiscordSocketClient and DiscordSocketRestClient share the same
backing API client, so the Log events on both clients will be raised
from the same API calls. Proxying log events from the
DiscordSocketRestClient then means that the Log event the user hooks
into will be raised twice for a single log message.

Thanks to @TheCasino for noticing this.
This commit is contained in:
Christopher Felegy
2019-05-19 12:16:37 -04:00
parent bc66d7ea4e
commit c78a6790b1

View File

@@ -132,10 +132,6 @@ namespace Discord.WebSocket
ExclusiveBulkDelete = config.ExclusiveBulkDelete;
State = new ClientState(0, 0);
Rest = new DiscordSocketRestClient(config, ApiClient);
Rest.Log += (log) =>
{
return _restLogger.LogAsync(log.Severity, log.Message, log.Exception);
};
_heartbeatTimes = new ConcurrentQueue<long>();
_stateLock = new SemaphoreSlim(1, 1);