Questions tagged [hubot]

Hubot is a an automation service / application. You can use hubot to provide access to resources through chat rooms, web services or other interfaces.

Hubot is a robot which runs using node.js and is written in coffee-script.

The documentation on the site does little justice to what Hubot can be used for, because it’s hard to explain that Hubot can be used for succinctly.

In short you can use Hubot to do anything that you are able to program.

See... terrible explanation.

Hubot can be configured to join your company chatroom and based on key words or regular expressions, Hubot can run commands, call APIs, execute scripts or programs… anything at all in the background and return the results to you in the chat room, without you having to change context.

I will give some examples of what Hubot can be used for to make understanding its value.

The two methods I will explain are: hear and respond . e.g.

robot.hear    /restart iis on "(.*)"/i, (msg) ->

robot.respond /restart iis on "(.*)"/i, (msg) ->

If you implement this as a respond function, you must address hubot directly in the chatroom.

john: hubot restart iis on myservername
bill: john just directly asked hubot to restart iis on myservername

However, if you were to implement this as a hear function. You could type a full sentence such as

john: I think if we restart iis on myservername it will resolve the issue.
bill: oops you just restarted the server

Hubot would automatically execute a restart of your iis server. In this case that would have been a bad thing.

With this basic premise that any task you can automate, can be implemented through hubot. You simply map a regular expression for hubot to watch for and either "hear" or "respond" to.

Here are a few ideas of how this could be of value:

  • Allow a person with no production access to execute specific tasks in production
  • Give developers are mechanism of requesting development environment refreshes from production in a chat room.
  • Since your interface to this functionality becomes your chatroom, you can use the chat room as audit documentation of who requested what task be completed.
  • Temporarily grant someone access to perform specific tasks by inviting them to special chat rooms, and removing them from the chatroom after the fact.

Here is a slide deck which discusses hubot/ chatops

ChatOps at GitHub by Jesse Newland

I hope this provides better insight into what hubot can do for you.

Find any repetitive task you do and give it a shot, see if you can write a hubot script to automate that task.

Check out sample scripts in the following deprecated repository for inspiration.

DEPRECATED HUBOT-SCRIPTS REPO

Official Info:

official hubot site

hubot source code

277 questions
0
votes
3 answers

Hubot: use set command for all input

I have an instance of hubot running on heroku. I don't need any of the default behaviour (for example help command). Instead I'd like to choose my own commands and just have users input text with commands. In this case I just want to run pb with…
Philip Kirkbride
  • 21,381
  • 38
  • 125
  • 225
0
votes
1 answer

Using hubot to have a converstion with a user

I am hoping to create a slackbot which when it's asked something to respond with a question and listen for an answer to that specific question, only when its asked though. For example User: @Hubot Please add a link to youtube Hubot: @User Can you…
danbeggan
  • 105
  • 7
0
votes
1 answer

CoffeeScript Hubot help: getting data from a function

I'm a novice in need of some Hubot/CoffeeScript help. I have several responses which will get data from the same source but use and respond to different pieces of the payload. For example... module.exports = (robot) -> robot.hear /score/i, (msg)…
0
votes
1 answer

Hubot not setting up properly: "hubot-redis-brain: using default redis..."

I have looked at the information on Hubot on their own actual website, I have tried everything, I have been on this problem for nearly just over a day and a half worth of hours. I am installing Hubot on a Virtual Machine using Linux, I would like…
Danny Watson
  • 165
  • 5
  • 24
0
votes
2 answers

Hubot Basic Authentication REST Call

With Hubot I am trying to access specific issues through JIRA REST api. url = http://myserver.com/jira/rest/api/2/search?jql=status="open"+AND+assignee=null robot.http(url).get() (err, res, body) -> # some code Hubot fails to reach the server.…
michaelbahr
  • 4,837
  • 2
  • 39
  • 75
0
votes
2 answers

hubot-slack throwing an error on startup

I am trying to add a new hubot integration to our Slack channels. I am setting this up on a Windows machine and am deploying to a Heroku server. I followed the installation instructions provided here: https://github.com/slackhq/hubot-slack I can…
codingintherain
  • 263
  • 4
  • 10
0
votes
2 answers

Run hubot as a part of express app

I have a pretty standard express app, built using the express-generator. Now, I would like to automate some of the things in the app with hubot and I have managed to successfully perform testing and run hubot with slack adapter. However, I would…
wont_compile
  • 855
  • 2
  • 17
  • 43
0
votes
1 answer

unexpected callback execution order

I'm writing a hubot script to list all of my CloudFormation stacks in AWS by region. I've written the following, and it works, except for the order of the data output. The script is: key = process.env.HUBOT_AWS_ACCESS_KEY_ID secret =…
Lee Fox
  • 217
  • 4
  • 10
0
votes
2 answers

Hubot - no arguments entered/parameters entered

I've just started using Hubot recently. I'd like to know if a command is used, but no arguments have been entered. robot.respond(/dothis (.*)/i, function(res) { ... }; This doesn't return anything if no arguments have been entered, even though it…
Pauline Kelly
  • 91
  • 1
  • 2
0
votes
1 answer

Hubot Slack: Removing from #general

I'm wondering if anyone has any form of solution for this? I've been googling for some time now and can't seem to find a solution. Is there a way to either remove Hubot from Slacks default #general channel or have him so he mutes himself and doesn't…
James Ives
  • 3,177
  • 3
  • 30
  • 63
0
votes
1 answer

Hubot get flowdock thread details (thread id & first message in thread)

I'm trying to write a small coffeescript for hubot that gets the first message in a thread and posts it to an external script. I can get the flow id and user id info from the msg object but can't seem to find any object that contains the thread info…
Andrei
  • 13
  • 5
0
votes
1 answer

What should the comment look like to be included as documentation for hubot?

As far as I've understood the hubot help command is supposed to list all commands based on the comment in the start of each script. For some reason it doesn't list the help for my file, can anyone spot the error? # Description: # Hubot interface…
Tomas Jansson
  • 22,767
  • 13
  • 83
  • 137
0
votes
1 answer

How to reference array from HTTP GET request?

I'm making a script for my hubot that's supposed to print out all of the items of a column in a Smartsheet document. Unfortunately, one cannot simply print all elements of a column, as the cells are primarily stored in rows. In order to reference a…
jwilso48
  • 1
  • 2
0
votes
1 answer

calling slack-hubot api with javascript _ result body always undefined

but it always return undefined body. Here is my source code. : static variables const TOKEN = 'xoxp-7186818662-7186899793-7811139362-ccc6df'; const emojiAPIUrl = 'https://slack.com/api/emoji.list'; :uses module.exports = function (robot) { …
Juneyoung Oh
  • 7,318
  • 16
  • 73
  • 121
0
votes
1 answer

Hubot-Cleverbot script issue heirarchy

I'm using a cleverbot script to have my bot respond to any type of messages. The script works but currently requires a user to call for the bot via "hey" For example "@bot hey what is going on?" bot: Not too much. Code: robot.respond(/hey (.*)/i,…
kkomaz
  • 261
  • 2
  • 10