def update_voice_state(data)
      @session_id = data['session_id']

      server_id = data['guild_id'].to_i
      server = server(server_id)
      return unless server

      user_id = data['user_id'].to_i
      old_voice_state = server.voice_states[user_id]
      old_channel_id = old_voice_state.voice_channel.id if old_voice_state

      server.update_voice_state(data)

      old_channel_id
    end
def update_voice_state(data)
      @session_id = data['session_id']

      server_id = data['guild_id'].to_i
      server = server(server_id)
      return unless server

      user_id = data['user_id'].to_i
      old_voice_state = server.voice_states[user_id]
      old_channel_id = old_voice_state.voice_channel.id if old_voice_state

      server.update_voice_state(data)

      old_channel_id
    end
Internal handler for VOICE_STATE_UPDATE