hubot-entrypoint

1.0.0 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i hubot-entrypoint

Weekly Downloads

1

Version

1.0.0

License

MIT

Unpacked Size

7.65 kB

Total Files

4

Last publish

Collaborators

  • crccheck