Ejemplo n.º 1
0
        private async Task OnDisconnected(Exception exception)
        {
            foreach (var player in _players.Values)
            {
                await player.DisposeAsync().ConfigureAwait(false);
            }
            _players.Clear();

            _log?.Invoke(VictoriaExtensions.LogMessage(LogSeverity.Error, "WebSocket disconnected! Disposing all connected players.", exception));
        }
Ejemplo n.º 2
0
        private async Task OnShardDisconnected(Exception exception, DiscordSocketClient socketClient)
        {
            foreach (var guild in socketClient.Guilds)
            {
                if (!_players.TryRemove(guild.Id, out var player))
                {
                    continue;
                }

                await player.DisposeAsync().ConfigureAwait(false);
            }

            _players.Clear();
            _log?.Invoke(VictoriaExtensions.LogMessage(LogSeverity.Error, "Shards disconnecting. Disposing all connected players.", exception));
        }