How to send Twitter Direct Message via API in javascript

Posted on January 8, 2023

If you have troubles sending Direct Message on Twitter using its API using the library twitter, and you get always the error "Could not authenticate you.", the solution is to change library. Simply as that.

Just swap to the library twit and your DM will turn working again.