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:
@@ -132,10 +132,6 @@ namespace Discord.WebSocket
|
|||||||
ExclusiveBulkDelete = config.ExclusiveBulkDelete;
|
ExclusiveBulkDelete = config.ExclusiveBulkDelete;
|
||||||
State = new ClientState(0, 0);
|
State = new ClientState(0, 0);
|
||||||
Rest = new DiscordSocketRestClient(config, ApiClient);
|
Rest = new DiscordSocketRestClient(config, ApiClient);
|
||||||
Rest.Log += (log) =>
|
|
||||||
{
|
|
||||||
return _restLogger.LogAsync(log.Severity, log.Message, log.Exception);
|
|
||||||
};
|
|
||||||
_heartbeatTimes = new ConcurrentQueue<long>();
|
_heartbeatTimes = new ConcurrentQueue<long>();
|
||||||
|
|
||||||
_stateLock = new SemaphoreSlim(1, 1);
|
_stateLock = new SemaphoreSlim(1, 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user