Use Meya.ai To Build An Amazing Twitter Direct Message Chatbot
Meya.ai, now part of the 21st 500 Startups batch, is a great platform for bot building and it’s one of the few platforms out there that integrate Twitter DMs. It’s fairly simple to use and easy to understand once you get basic knowledge of it’s language, YAML.
Personally, I am a visual learner so when I first discovered Meya, I found it pretty confusing even when having read the docs. I didn’t really know how to write any code for the bot. I asked around a bit, mostly Meya support, and they provided some help and a few examples for me to get started. From there, I basically used trial and error to create my bot. One thing about Meya that I really like, is the way it’s set up. If you need to edit your bot, you can do that with a few clicks of a button.
When you first sign up for Meya and you have the STARTUP plan, you can add a Twitter Integration and connect your account.
The rest of this article will be a full tutorial, with visuals, on how to build your chatbot. I will make the code available for anyone to clone.
What will this bot contain?
1. A Welcome Message
2. Main Menu with 3 options. ‘ Interactive Polls’, 🔨 Learn More’, ‘➕ More Options’.
3. Interactive Polls’ will contain 6 polls to choose from. ‘Favorite social media platform’, ‘😎 Favorite Emoji’, ‘🎥 Favorite Netflix drama series’, ‘🎥 Favorite Netflix comedy series?’, ‘🇺🇸 Dwayne Johnson for President?’, ‘ and ‘🏠 Home’.
4. Learn More’ will provide text and a few links about the bot when clicked.
5. More Options’ will have 10 additional options to choose from. ‘Play a bot song’, ‘😂 Tell me a joke’, ‘🤔 Play Trivia’, ‘🙂 Send me a meme’, ‘🙌 Send me a gif’, ‘❓I have a question’, ‘💬 I have a comment’, ✉️ I need to contact you’, ‘ 👍 Your DM’s are cool’, and ‘🏠 Home’
6. The ability to know the name of the user that starts a DM conversation.
Connect your Twitter account.
Go to the Twitter’s Business Dashboard and enable Business Features for the Twitter account that you want the bot to function on. Make sure to enable ‘Receive Direct Messages from anyone’.
Create a welcome message
View this Github Repository and copy each flow into the Bot Studio
Intents are VERY important. They can be Keywords that when typed and sent, will trigger a flow. For example, if I have my main_menu flow Intent set to Keyword, and that keyword is ‘/home’, when someone sends ‘/home’ they will be brought back to the main menu. Click this link to view the intents I have set. You will see the Flow Name, the Intent Type, and the Keyword. Find each flow listed and add an intent.
You have successfully built a DM chatbot using Meya.ai.
View this bot on Twitter:
Did you build a bot?
I’d love to see it - Tweet me @SamSchmir
Need to Contact Me?
1. Tweet me or send me a DM @SamSchmir
2. Email me: firstname.lastname@example.org