1.0.0 • Published 6 years ago

hubot-entrypoint v1.0.0

Weekly downloads
10
License
MIT
Repository
github
Last release
6 years ago

Hubot Entrypoint

Start Hubot v2 with require.

Currently, the only way to start Hubot is from the command line. But there may be times you need to start Hubot from another Node script.

This script was made by running Decaffeinate on the Hubot CLI CoffeeScript. I haven't checked how this would work with Hubot v3 yet.

Quick start

const hubotEntrypoint = require('hubot-entrypoint')

const bot = hubotEntrypoint()

bot.start()

Options

The options you would normally pass on the command line can be passed in too:

const hubotEntrypoint = require('hubot-entrypoint')

const bot = hubotEntrypoint({
  adapter: 'slack',
  name: 'Huboto',
})

bot.start()

robot

.start() returns robot. So if you need to do some tweaks outside scripts, you can. For example:

...
const robot = bot.start()
robot.router.get('/robots.txt', (request, response) => {
  response.send('User-agent: *\nDisallow: /')
})

Additional reading

1.0.0

6 years ago

1.0.0-alpha.3

6 years ago

1.0.0-alpha.2

6 years ago

1.0.0-alpha

6 years ago