How to Build Basic Chatbot with Golang & FB Messenger

Golang Messenger Bot

Hi everyone! Still with me to share some experience, thought, or opinion about technology-related with the software engineering field. In this article, I want to share how to create a simple Chatbot on Messenger using Golang!

To give some context to what we should do, here are several points we will handle:

  • Have a Facebook account or create a new one.
  • Create a Facebook page.
  • Create a Facebook app (should be auto-created).
  • Create a webhook server.

Architecture Design

To receive a message sent by the end-user to the Messenger (Facebook page), we need to provide a Webhook server with REST API. The architecture design will look like this diagram:

Chatbot Architecture Design

Facebook Account

I guess nowadays, people have a Facebook account. However, if not, visit https://www.facebook.com to easily Sign Up by clicking Create New Account button.

Create a Facebook Account

Facebook Page

Creating a Facebook page can be done through the menu on the homepage.

Facebook Page Menu

Then click on the Create New Page button to go to a Create a Page Form.