Create your own evil robot overlord on Messenger with 6 simple steps

Nir Lankā
Embla Tech
Published in
3 min readMar 20, 2018

Step 1. Create a free server

#freeServersForTheWin #GlitchFTW

First create a clone of the Evilbot server template:

  1. Go to https://glitch.com and sign up using GitHub.
  2. Go to https://glitch.com/~evilbot and click on “Remix your own”.

A server will be created with Evilbot code as a new Glitch project.

Step 2. Create a Facebook app

This photo is extremely completely really related to the subject matter. Not at all a filler meme.

Go to https://developers.facebook.com.

  1. Register as a developer on Facebook.
  2. Create a new app and give it a name and an email address**
  3. Inside the app, click “Set up” in the “Messenger” card.
  4. In the “Token Generation” section, click “Create a new page” to create a page for the bot as its profile.

**_ You can use the same Gmail address for multiple apps. Simply add a tag after a “+”, as in “yourname+app1@gmail.com”

Step 3. Connect Fb app to Glitch app

Image result for serverless meme
Another totally relevant meme

In the dashboard of the created app,

  1. Select the created page
  2. Copy the “Page Access Token” value to the .env file in the Glitch project, for PAGE_ACCESS_TOKEN=.
  3. Click “Setup Webhooks” in the “Webhooks” section.
  4. Add https://APPNAME.glitch.me where APPNAME is the project url ID in the Glitch project. This URL is the server you’re going to be programming.
  5. In “Verify Token”, enter a token of your choice: e.g. “myrandomtoken”.
  6. Put the same verify token in the .env file, next to VERIFY_TOKEN=.
  7. In “Subscription Fields”, check messages andmessaging_postbacks for now.
  8. Enable NLP in the “Built-In NLP” section.

Step 4. Add Test Users

Testing is vital to developing a bot that’s actually useful

In the Facebook app dashboard,

  1. Select “Roles” on the left-side menu.
  2. In the submenu, select “Roles”… again.
  3. Add your friends into any role, so that they can use the bot from Messenger.

Step 5. Program the bot

Code like a maniac :D

In the Glitch project,

  1. Open the bot.js file and edit it to change the program.
  2. You can split the logic and code into separate .js files and import them with require(..).
  3. Consult the Evilbot Wiki on Github at https://github.com/EmblaTech/evilbot/wiki.

Step 6. Profit!!

Step 6: PROFIT $$$

--

--