private static Packet DoAction(VoicePayload payload)
 {
     return(new Packet(
                CommandHandler.PlayerHash,
                CommandConst.ActionVoiceMuteState,
                JsonConvert.SerializeObject(payload, new JsonSerializerSettings
     {
         NullValueHandling = NullValueHandling.Ignore,
         DefaultValueHandling = DefaultValueHandling.Ignore
     })));
 }
Example #2
0
        private Task OnVSU(SocketVoiceServer server)
        {
            if (!server.Guild.HasValue)
            {
                return(Task.CompletedTask);
            }

            if (!_players.TryGetValue(server.Guild.Id, out _))
            {
                return(Task.CompletedTask);
            }

            var voiceUpdate = new VoicePayload(server, _voiceState);

            LavaSocket.SendPayload(voiceUpdate);
            return(Task.CompletedTask);
        }
Example #3
0
 public QueueItem(VoicePayload payload, TaskCompletionSource <bool> result)
 {
     Payload = payload;
     Result  = result;
 }