Implemented ClientDisconnect event for audio client. (#2520)
This commit is contained in:
@@ -11,7 +11,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Discord.Audio
|
||||
{
|
||||
@@ -279,6 +279,15 @@ namespace Discord.Audio
|
||||
await _speakingUpdatedEvent.InvokeAsync(data.UserId, data.Speaking);
|
||||
}
|
||||
break;
|
||||
case VoiceOpCode.ClientDisconnect:
|
||||
{
|
||||
await _audioLogger.DebugAsync("Received ClientDisconnect").ConfigureAwait(false);
|
||||
|
||||
var data = (payload as JToken).ToObject<ClientDisconnectEvent>(_serializer);
|
||||
|
||||
await _clientDisconnectedEvent.InvokeAsync(data.UserId);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
await _audioLogger.WarningAsync($"Unknown OpCode ({opCode})").ConfigureAwait(false);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user