{"action":"created","issue":{"url":"https://api.github.com/repos/hubotio/evolution/issues/3","repository_url":"https://api.github.com/repos/hubotio/evolution","labels_url":"https://api.github.com/repos/hubotio/evolution/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/hubotio/evolution/issues/3/comments","events_url":"https://api.github.com/repos/hubotio/evolution/issues/3/events","html_url":"https://github.com/hubotio/evolution/pull/3","id":231904040,"number":3,"title":"Programmatically configured bot","user":{"login":"technicalpickles","id":159,"avatar_url":"https://avatars1.githubusercontent.com/u/159?v=3","gravatar_id":"","url":"https://api.github.com/users/technicalpickles","html_url":"https://github.com/technicalpickles","followers_url":"https://api.github.com/users/technicalpickles/followers","following_url":"https://api.github.com/users/technicalpickles/following{/other_user}","gists_url":"https://api.github.com/users/technicalpickles/gists{/gist_id}","starred_url":"https://api.github.com/users/technicalpickles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/technicalpickles/subscriptions","organizations_url":"https://api.github.com/users/technicalpickles/orgs","repos_url":"https://api.github.com/users/technicalpickles/repos","events_url":"https://api.github.com/users/technicalpickles/events{/privacy}","received_events_url":"https://api.github.com/users/technicalpickles/received_events","type":"User","site_admin":true},"labels":[{"id":609899870,"url":"https://api.github.com/repos/hubotio/evolution/labels/In%20Progress","name":"In Progress","color":"ffffff","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-05-29T00:03:46Z","updated_at":"2017-06-16T01:01:13Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/hubotio/evolution/pulls/3","html_url":"https://github.com/hubotio/evolution/pull/3","diff_url":"https://github.com/hubotio/evolution/pull/3.diff","patch_url":"https://github.com/hubotio/evolution/pull/3.patch"},"body":"A programmatically configured hubot would allow for developers to write a index.coffee (or Javascript-VM-language-of-choice file) to build their bot step-by-step. This would give fine-grained control of a Hubot instance, such as control of the script load order, customization of the built-in [Express](https://expressjs.com/) router, tuning and instrumentation of the Node.js VM.\r\n\r\n```coffeescript\r\nHubot   = require 'hubot'\r\nLog     = require 'log'\r\nPath    = require 'path'\r\n\r\nrobot = new Hubot.Robot\r\nrobot.logger = new Log('info')\r\nrobot.adapter = new Hubot.BuiltinAdapters.Shell(robot)\r\nrobot.alias = '/'\r\n\r\n# wait for adapter to connect, since it might change robot.name at runtime,\r\n# like robot name\r\nrobot.adapter.on 'connected', ->\r\n\r\n  # require external hubot scripts\r\n  robot.loadScriptPackage require('hubot-help')\r\n  robot.loadScriptPackage require('hubot-shipit')\r\n\r\n  # load scripts from a local scripts directory\r\n  # NOTE you need to either specify NODE_PATH=. or Path.resolve a local directory for this to work\r\n  robot.load Path.resolve 'scripts'\r\n\r\n  # or do things them inline\r\n  robot.respond /ping/i, (res) ->\r\n    res.send 'PONG'\r\n\r\n# then run hubot\r\nrobot.run()\r\n```\r\n\r\n👀 **[read the proposal](https://github.com/hubotio/evolution/blob/2936e53d16c7e980b340bfaaa7c4241659480a04/_drafts/programatically-configured-bots.md)** 👀"},"comment":{"url":"https://api.github.com/repos/hubotio/evolution/issues/comments/308904669","html_url":"https://github.com/hubotio/evolution/pull/3#issuecomment-308904669","issue_url":"https://api.github.com/repos/hubotio/evolution/issues/3","id":308904669,"user":{"login":"technicalpickles","id":159,"avatar_url":"https://avatars1.githubusercontent.com/u/159?v=3","gravatar_id":"","url":"https://api.github.com/users/technicalpickles","html_url":"https://github.com/technicalpickles","followers_url":"https://api.github.com/users/technicalpickles/followers","following_url":"https://api.github.com/users/technicalpickles/following{/other_user}","gists_url":"https://api.github.com/users/technicalpickles/gists{/gist_id}","starred_url":"https://api.github.com/users/technicalpickles/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/technicalpickles/subscriptions","organizations_url":"https://api.github.com/users/technicalpickles/orgs","repos_url":"https://api.github.com/users/technicalpickles/repos","events_url":"https://api.github.com/users/technicalpickles/events{/privacy}","received_events_url":"https://api.github.com/users/technicalpickles/received_events","type":"User","site_admin":true},"created_at":"2017-06-16T01:01:13Z","updated_at":"2017-06-16T01:01:13Z","body":"@gr2m that makes a lot of sense, thanks!\r\n\r\nI'll update to reflect that the `hubot` binary would continue to exist for simple use cases of just loading a bunch of scripts from `scripts` and `external-scripts.json`, and that you can use the module directly for more advanced usage."}}
{"actor":{"display_login":"technicalpickles"}}