That doesn't sound very complicated to implement, however it would be a massive work if it had to support multiple shortener services.
The easiest is probably to get such an extension commissioned for your specific service.
Particularly if the service is not hosted on the same server, there's a whole of different options when it comes to when the links are converted. The best would be to delegate everything to an asynchronous job using a queue worker, otherwise it might significantly slow down the posting time and even lead to timeouts if a post contains many links. And then everything related to error handling and retries if the external service is down or rate limited.