Publishing My First Bot

Yesterday the Bot for Messenger Challenge organized by Facebook came to a close. It marked the end of a month filled with highs and lows.

Today StockQuotes is live. Giving me the right to call myself a Bot Developer. In truth though, I am a far from being competent but its always great to end a month with a new achievement.

StockQuotes was built in 1 day. I started it on the 25th of this month and submitted it on the 26th. It wasn’t what I had in mind when I started my entry for this competiton and this blog post will look into how this came to be.

The way StockQuotes works if that when you type in a symbol for a stock on the global stock market eg “msft”, it returns its name and price. I used the Yahoo! Finance API for this.

When I first heard about the competition, I had some misgivings about submitting an entry. I was working with some teams for the Technovation Challenge and I knew I would need time to get an entry ready.

This wasn’t helped by seeing the term ARV in the terms and conditions for the competition. I was also in the middle of writing my 3rd book.

I remember making a post in the Facebook Developer Circle: Lagos about this. It turned out that I didn’t need to as it was me who failed to read the terms and conditions correctly.

I didn’t attend the Bot Party as I thought of it as  a waste of time. I personally think all tech events are a waste of time so nothing personal here.

I had to make a decision. I stepped back and considered the competition from all sides. Why would Facebook do this? The most basic reason would be to spread awareness about the Facebook Messenger Bot platform. Why should I do this? With IoT being the rave, bots represent a possible use case.

Once I had my answers I decided to enter the competition. My entry was to be a simple bot for playing Tic Tac Toe. I made my designs using the paradigms I had and started doing my research.

Going into this competition, I faced 3 major constraints:

  1. The absence of electricity at home
  2. No special funding
  3. A lack of experience in developing bots

If you live in Nigeria, you will understand Constraint 1. Constraint 2 is due to the fact that it is always great for a developer to be able to focus exclusively on a project especially a new project like this. I didn’t have this luxury so I had to balance work and this competiton. Constraint 3 would be true for a lot of developers entering this competition.

Building Tic Tac Bot took a lot from me. I wanted to make it work but sadly that turned out not the be the case. The Facebook Messenger platform is still under developed. I discovered the hard way that it is a memoryless system and in trying to use a MySQL database, it crashed. The screen shot of this is given below:

That was when I knew I wouldn’t make it in time. I discovered this on the 25th with 3 days left to go. Distraught I gave up for a while. It was while bathing that I realized that I could design StockQuotes based off a tutorial in App Inventor.

App Inventor is the unofficial programming language for the Technovation Challenge. I had to learn it in mentoring the teams from Lagos State so I had a strong grasp of it.

That was how StockQuotes came to be. In just 1 night after a whole month of toiling. I have developed and submitted my first Bot.

I developed my first bot on the 24th of last month. It was based off a Youtube tutorial. In that tutorial, I had gotten the basics of developing for the Facebook Messenger Bot platform.

The Facebook Messenger Bot platform needs to get the following for me to recommend it to anyone:

  1. Facebook Messenger SDK: I didn’t enjoy naked coding against that platform even though I have a sandbox because of the data cost.
  2. Error Reporting: At the moment if there is an error in your code, your bot doesn’t work. It tells you nothing.
  3. Debugging Capabilities: There is no way to print how what a value is doing except to change it to a message.
  4. Session Handling: PHP developers will understand this concept. There is no way to do this.
  5. PHP Support: Nigeria is PHP country. The reason for this is because Nigeria is a failed state where nothing works. If I struggle to download a programming environment and need to go online everytime I want to create a new project, that programming environment doesn’t match my reality and that is why NodeJS struggles for adoption in Nigeria.

I intend to develop Tic Tac Bot but I need to learn how to use Amazon Web Services and MongoDB. At the moment, that is the direction I am heading in.

The Technovation teams from Lagos successfully submitted their entries and my third book also came out. The month of April although stressful for me turned out to be a great month for me.

See you in May.