public ServerVoiceChannel getOrCreateServerVoiceChannel ( JsonNode data ) { long id = Long . parseLong ( data . get ( "id" ) . asText ( ) ) ; ChannelType type = ChannelType . fromId ( data . get ( "type" ) . asInt ( ) ) ; synchronized ( this ) { if ( type == ChannelType . SERVER_VOICE_CHANNEL ) { return getVoiceChannelById ( id ) . orElseGet ( ( ) -> new ServerVoiceChannelImpl ( api , this , data ) ) ; } } // Invalid channel type return null ; }
Gets or creates a server voice channel .