Create your own evil robot overlord on Messenger with 6 simple steps
Published in
3 min readMar 20, 2018
Step 1. Create a free server
First create a clone of the Evilbot server template:
- Go to https://glitch.com and sign up using GitHub.
- 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
Go to https://developers.facebook.com.
- Register as a developer on Facebook.
- Create a new app and give it a name and an email address**
- Inside the app, click “Set up” in the “Messenger” card.
- 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
In the dashboard of the created app,
- Select the created page
- Copy the “Page Access Token” value to the
.env
file in the Glitch project, forPAGE_ACCESS_TOKEN=
. - Click “Setup Webhooks” in the “Webhooks” section.
- 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. - In “Verify Token”, enter a token of your choice: e.g. “myrandomtoken”.
- Put the same verify token in the
.env
file, next toVERIFY_TOKEN=
. - In “Subscription Fields”, check
messages
andmessaging_postbacks
for now. - Enable NLP in the “Built-In NLP” section.
Step 4. Add Test Users
In the Facebook app dashboard,
- Select “Roles” on the left-side menu.
- In the submenu, select “Roles”… again.
- Add your friends into any role, so that they can use the bot from Messenger.
Step 5. Program the bot
In the Glitch project,
- Open the
bot.js
file and edit it to change the program. - You can split the logic and code into separate
.js
files and import them withrequire(..)
. - Consult the Evilbot Wiki on Github at https://github.com/EmblaTech/evilbot/wiki.