I looked at what signal-cli did and tried to do the same. Big thanks to AsamK for actually figuring this out