When I did this project I was on the last day of my challenge for the week. I almost want to say not this week and take a break this day. But when I was watching tv for fun I just got an idea about just making a small chat bot. Nothing too crazy, so I search in the net which one of API I can use for this. I finally decide to go with the Twitter one cause the documentation is really good.
The first thing I always want to see how this kind of bot is created. I know this is nothing really difficult but someone curious like me always wants to see what happen behind the scene. For like a week before this idea, I was following the #100DaysOfCode challenge on twitter. Where people talk about what they did today in their challenge and what they learn. I know a bot was already built for that with the Free Code Camps team so I just decided to change the way the bot message.
I choose to send motivation message with some super-heroes from “Marvel & DC” cause I loved everything about this. Plus we all know the message they passed in some movies or BD is a good source of motivation.
This is the code I wrote for be sure I don’t let my bot to reply to other bots.
This is the only place of code who is maybe not standard all the rest of my code is using
I really like the async await syntax. I just started to use it and that make the code so much cleaner. I know the promise is a big step from the callback hell. But this
async await is the better for human readability.
That was a quick little challenge and I recommend everyone to just try to make one. This is a quick little project where you can learn some good practice and for the beginner to understand how to read API documentation.