The SpaceX Launch Notifier Bot - Just in time for the Falcon Heavy Launch
How I made a messenger bot with Django and Chatfuel and connected with over 1000 SpaceX fans.
How I made a messenger bot with Django and Chatfuel and connected with over 1000 SpaceX fans.
It started with an idea in a galaxy far, far away
In September 2016, when everyone was raving about bots, I had the idea to make a bot that would notify you every time SpaceX launches another rocket and send a link to the livestream (SpaceX streams every launch on their webcast page).
The idea was simple, but I never got around to making it, as other projects interfered.
I also have the feeling that at that time bots were supposed to be real bots you could ask questions and talk to. It would be more dependant on NLP (natural language processing). What that means is that you could ask it "When's the next launch?" and "When's the next one?", and through machine learning it would decide that those two questions are basically the same.
These days, when you interact with a bot, it feels like an app in chat format. You have a menu, with pre-set questions and you go through a narrow, pre-defined flow. It's much easier to make that way.
When SpaceX announced they would conduct the Falcon Heavy's maiden launch on February 6, 2018, I decided to finally create the bot I wanted to make.
The technical stuff
The bot needed to be able to do three things:
- Show a menu
- Broadcast messages
- Connect to a JSON api
Functions 1 and 2 can be found in almost every bot platform. The third one isn't, as ManyChat for example does not have it.
That's why I decided to build the bot in Chatfuel as Chatfuel was the cheapest option that allowed me to integrate a JSON API.
First I added the menu:
The "Who made this?" question always answers the same, so that's easy to add in Chatfuel.
The "When is the next launch?" question, connects to a JSON api I made in Django. I added a list of all the upcoming SpaceX launches as models in Django, with info such as the launch pad, launch window, payload, etc.
Everytime someone clicks (or asks) the bot when the next launch is, it will check the database for the launch in the near future. Basic stuff, right? Then they can get more information.
And as soon the SpaceX live stream is available, which is about an hour before the launch, I broadcast it to everyone that is subscribed (which happens automatically when they start a conversation with the bot).
(Look at that open rate! The marketer in me is proud 😄)
To get the bot into the hands of people, I created a few Facebook ads that linked to the Messenger bot. It also appeared on a few chatbot marketplaces, but to be completely honest I didn't spend as much time marketing it as I could have.
If want to try it, you can check it out here or check out my personal chatbot!
If you'd love to connect on LinkedIn, you can add me here. If these kind of posts interest you, make sure to subscribe to the newsletter down below!