Browse Source

Amend based on feedback

pull/984/head
Devoxin 8 years ago
parent
commit
29db63d4d1
1 changed files with 5 additions and 3 deletions
  1. +5
    -3
      src/Discord.Net.WebSocket/DiscordSocketClient.cs

+ 5
- 3
src/Discord.Net.WebSocket/DiscordSocketClient.cs View File

@@ -5,7 +5,7 @@ using Discord.Net.Converters;
using Discord.Net.Udp; using Discord.Net.Udp;
using Discord.Net.WebSockets; using Discord.Net.WebSockets;
using Discord.Rest; using Discord.Rest;
using Discord.WebSocket.Entities.Guilds;
using Discord.WebSocket;
using Newtonsoft.Json; using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using System; using System;
@@ -1465,6 +1465,10 @@ namespace Discord.WebSocket


var data = (payload as JToken).ToObject<VoiceServerUpdateEvent>(_serializer); var data = (payload as JToken).ToObject<VoiceServerUpdateEvent>(_serializer);
var guild = State.GetGuild(data.GuildId); var guild = State.GetGuild(data.GuildId);

var voiceServer = new Entities.Guilds.SocketVoiceServer(data.GuildId, data.Endpoint, data.Token);
await TimedInvokeAsync(_voiceServerUpdatedEvent, nameof(UserVoiceStateUpdated), voiceServer).ConfigureAwait(false);

if (guild != null) if (guild != null)
{ {
string endpoint = data.Endpoint.Substring(0, data.Endpoint.LastIndexOf(':')); string endpoint = data.Endpoint.Substring(0, data.Endpoint.LastIndexOf(':'));
@@ -1476,8 +1480,6 @@ namespace Discord.WebSocket
return; return;
} }


SocketVoiceServer VoiceServer = new SocketVoiceServer(data.GuildId, data.Endpoint, data.Token);
await TimedInvokeAsync(_voiceServerUpdatedEvent, nameof(UserVoiceStateUpdated), VoiceServer).ConfigureAwait(false);
} }
break; break;




Loading…
Cancel
Save