This commit is contained in:
Kwoth 2017-01-04 01:16:56 +01:00
parent 8ea62fd807
commit d2f4cbeec1

View File

@ -67,17 +67,11 @@ namespace NadekoBot
_log.Info($"Shard #{i} initialized.");
var j = i;
client.Disconnected += async (ex) =>
client.Disconnected += (ex) =>
{
try
{
_log.Error("Shard #{0} disconnected", j);
_log.Error(ex, ex?.Message ?? "No error");
try { await client.DisconnectAsync().ConfigureAwait(false); } catch { }
await client.ConnectAsync().ConfigureAwait(false);
}
catch { }
_log.Error("Shard #{0} disconnected", j);
_log.Error(ex, ex?.Message ?? "No error");
return Task.CompletedTask;
};
}