Twitter has a feature to allow you to set a default welcome message in your DM. For example, this is mine:
The catch: you have to set it up via API.
Official docs: https://developer.twitter.com/en/docs/twitter-api/v1/direct-messages/welcome-messages/overview
The steps
To save you some time, here are what you need to do (the easiest way):
Install twurl
:
gem install twurl
Authorize (You need a Twitter V1 developer account with an app with "Read + Write + Direct Messages" permission):
twurl authorize --consumer-key KEY \
--consumer-secret SECRET
Then follow the instruction to authorize.
Next, create a welcome message (change the CHANGE THIS
string to your own message):
twurl -A 'Content-type: application/json' /1.1/direct_messages/welcome_messages/new.json -d '{"name": "simple_welcome-message", "welcome_message": {"message_data": {"text": "CHANGE THIS"}}}'
You will receive something like this in the response. Copy the ID.
Set the welcome message as "default":
twurl -A 'Content-type: application/json' -X POST /1.1/direct_messages/welcome_messages/rules/new.json -d '{"welcome_message_rule": {"welcome_message_id": "PASTE_THE_ID_HERE"}}'
That's all. You are all set! 🎉
Remove the message
List the rules:
twurl -X GET "/1.1/direct_messages/welcome_messages/rules/list.json"
Then find the rule ID (there should only be 1 rule).
Delete the rule:
twurl -X DELETE "/1.1/direct_messages/welcome_messages/rules/destroy.json?id=RULE_ID_HERE"
Now your default message is gone.
👋 Like what you read here?
Hello there, I'm Tony Dinh.
I quit my high paying job to work on my side projects with a mission to make a living from my apps and live an independent life. 🌴
- 🛠️ I built a macOS app for developers: DevUtils.app
- 🎩 I built a browser extension for Twitter: BlackMagic.so
- 🏖️ Read my story → https://newsletter.tonydinh.com/
- 💻 Everything about me → https://tonydinh.com
❤️ Thanks for reading!