public void sendVoiceStateUpdate ( Server server , ServerVoiceChannel channel , Boolean selfMuted , Boolean selfDeafened ) { ObjectNode updateVoiceStatePacket = JsonNodeFactory . instance . objectNode ( ) . put ( "op" , GatewayOpcode . VOICE_STATE_UPDATE . getCode ( ) ) ; if ( server == null ) { if ( channel == null ) { throw new IllegalArgumentException ( "Either server or channel must be given" ) ; } server = channel . getServer ( ) ; } User yourself = api . getYourself ( ) ; updateVoiceStatePacket . putObject ( "d" ) . put ( "guild_id" , server . getIdAsString ( ) ) . put ( "channel_id" , ( channel == null ) ? null : channel . getIdAsString ( ) ) . put ( "self_mute" , ( selfMuted == null ) ? server . isSelfMuted ( yourself ) : selfMuted ) . put ( "self_deaf" , ( selfDeafened == null ) ? server . isSelfDeafened ( yourself ) : selfDeafened ) ; logger . debug ( "Sending VOICE_STATE_UPDATE packet for channel {} on server {}" , channel , server ) ; websocket . get ( ) . sendText ( updateVoiceStatePacket . toString ( ) ) ; }
Sends the voice state update packet .