hubot-entrypoint
Launch Hubot with require()
Last updated 2 years ago by crccheck .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install hubot-entrypoint 
SYNC missed versions from official npm registry.

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

Current Tags

  • 1.0.0                                ...           latest (2 years ago)

4 Versions

  • 1.0.0                                ...           2 years ago
  • 1.0.0-alpha.3                                ...           2 years ago
  • 1.0.0-alpha.2                                ...           2 years ago
  • 1.0.0-alpha                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 3
This Month 5
Last Day 2
Last Week 0
Last Month 4
Dependencies (1)
Dev Dependencies (1)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |