Skip to content

stefanbohacek/creative-bots

Repository files navigation

Creative bots

Tweetin'

This is a template for making creative online bots.

A quick tutorial

Read the full tutorial on my blog. In short:

  1. Choose where you want to host your bot. Note that these services require a paid subscription.
  1. Create accounts for all of your bots. Currently supported networks:
  1. Update the .env file with your Twitter API keys/secrets.
  2. 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:

And be sure to submit your finished bot to Botwiki :-)

FAQ and known issues

Bots that use puppeteer stopped working.

Update puppeteer to the latest version.

Support Botwiki/Botmakers

🙇