This is a template for making creative online bots.
Read the full tutorial on my blog. In short:
- Choose where you want to host your bot. Note that these services require a paid subscription.
- remix this project on Glitch (pricing)
- import to Heroku (pricing)
- import to repl.it (pricing)
- download the code from GitHub and host it on your own server
- Create accounts for all of your bots. Currently supported networks:
- Update the
.env
file with your Twitter API keys/secrets. - All bots are automatically loaded from the
bots
folder. Update an existing bot, or add your own.
Each bot file needs to export an object with the following information:
{
active: true,
name: 'A basic bot',
description: 'Just a very basic bot!',
interval: cronSchedules.EVERY_THREE_HOURS,
script: function(){
/* This is your bot's main code. */
}
}
You can change active
to false
to prevent a bot from being scheduled. For interval
you can either use one of the values inside helpers/cron-schedules.js
, or you can use a custom cron schedule -- see the cron package documentation for more details.
And to test your bot, uncomment the code starting on line 15 inside server.js
:
const bot = require(__dirname + "/bots/random-image.js");
bot.script();
(Remember to comment it back out when you're done.)
A few more resources to get you started:
-
stefans-creative-bots my own remix of this project
-
Botwiki for tutorials and open source bots
-
the Botmakers Slack group
And be sure to submit your finished bot to Botwiki :-)
Bots that use puppeteer stopped working.
Update puppeteer to the latest version.
🙇