You can still post media to Twitter, but you need to use an API v1 call to post the media, then a v2 call to post the actual message using the ID from the v1 to attach the media.
This tutorial by @Jeremy_DE_CAMPOS explains the process. It’s in French, but the subtitle auto-translate works great.