Fixed voice region caching

This commit is contained in:
RogueException
2016-05-27 05:32:15 -03:00
parent 28247b17d0
commit e16eb4e895

View File

@@ -160,8 +160,6 @@ namespace Discord.WebSocket
try try
{ {
await ApiClient.ValidateToken().ConfigureAwait(false); await ApiClient.ValidateToken().ConfigureAwait(false);
var voiceRegions = await ApiClient.GetVoiceRegions().ConfigureAwait(false);
_voiceRegions = voiceRegions.Select(x => new VoiceRegion(x)).ToImmutableDictionary(x => x.Id);
} }
catch (HttpException ex) catch (HttpException ex)
{ {
@@ -169,6 +167,9 @@ namespace Discord.WebSocket
} }
} }
var voiceRegions = await ApiClient.GetVoiceRegions().ConfigureAwait(false);
_voiceRegions = voiceRegions.Select(x => new VoiceRegion(x)).ToImmutableDictionary(x => x.Id);
LoginState = LoginState.LoggedIn; LoginState = LoginState.LoggedIn;
} }
catch (Exception) catch (Exception)