Tbot is based on Hubot (which you can read more about on the original README.md file
This TBot is in action with the Security Innovation Slack environment, so if you have access to it, say hi to tbot there
Here is how to run locally and test it
- clone this repo using :
[email protected]:TeamMentor/TBot.git**
- open folder and install dependencies
cd TBot
npm install
- run using
bin/hubot
(note: you might need to press enter once, and locally , you can ignore that HUBOT_HEROKU_KEEPALIVE_URL message)
- ask tbot for help
tbot help
- ask tbot to open some doors :)
tbot open the house doors
tbot open the pod bay doors
Here is a simple way to write a custom TBot script
- open the repo in an editor (in this case using Atom) and open the example.coffee file
- make a simple change, like for example:
robot.respond /tm head/i, (res) ->
res.reply 'The current HEAD commits are:....'
- restart tbot and execute the new command
tbot tm head
- here is a better example of a more useful tbot command
require 'fluentnode'
request = require 'request'
module.exports = (robot) ->
robot.respond /tm head/i, (res) ->
options = {url : 'https://api.github.com/repos/TeamMentor/TM_4_0_Design/git/refs/heads/master', headers: { 'User-Agent': 'Tbot'}}
request options, (error, response, body)->
#console.log body.json_Pretty
res.reply 'The current HEAD of TM Design is: ' + body.json_Parse().object.sha
- which when executed shows the current commit SHA value
tbot tm head
- once we have a script, the next step is to commit it, and push it to both origin and heroku repos
- After deployment to heroku the command will be available on Slack
... when directly chatting with tbot
... or in a channel when sending a message directly to tbot