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

282 questions
33
votes
2 answers

Can I write scripts for hubot in Javascript?

Hubot is Github's chatroom robot. It's a great tool, except that no one at our company wants to write in Coffeescript....but it appears that we can't write scripts for Hubot in plain old Javascript. Is this true? Is there something I'm missing…
James P. Wright
  • 8,663
  • 18
  • 72
  • 136
25
votes
1 answer

Where can i see hubot logger messages?

I am new to hubot and there i see a statement robot.logger.debug "trying gitio on #{commit.url}" Can someone tell me where can i see this debug message. I am using ./bin/hubot command to run it. Is there any way to run it in debug mode? so I…
Baran
  • 1,064
  • 1
  • 10
  • 23
25
votes
2 answers

Add Post support to Hubot

I am trying to add the http-post-say.coffee script to a hubot app which is hosted on Heroku. The documentation indicates that once you add the script then it creates the '/hubot/say' route which accepts post requests in the following format. curl…
Dru
  • 8,794
  • 13
  • 43
  • 66
19
votes
1 answer

Unable to install hubot - npm dependency not met

While trying to deploy hubot, npm keeps complaining about unmet dependencies. The documentation does not explain how to get around this. yum install npm --enablerepo=epel yum install nodejs --enablerepo=epel cd /opt git clone…
spuder
  • 14,200
  • 14
  • 77
  • 129
17
votes
2 answers

Google Hangouts adapter for Hubot?

I'm currently playing around a bit with Hubot and want to connect it to my and my friends hangout channel. The problem is that I can't seem to find an adapter. There may not exist one (as google hangouts pretty recently remodeled their api) but I…
nyson
  • 1,032
  • 6
  • 20
15
votes
2 answers

Get Hubot to talk at a certain time?

I'm thinking about making a Hubot clock-based notifier (think "It's 5, time to go home!" but less annoying and for a different reason). What's the best way to go about doing something like this in a Hubot script? [edit] Here's an example using…
NickAldwin
  • 10,954
  • 11
  • 47
  • 65
14
votes
1 answer

Error: connect EINVAL 0.0.xx.xx:80 - Local (0.0.0.0:0)

I'm trying to use hubot msg object to send http request, but finally get this error: Error: connect EINVAL 0.0.xx.xx:80 - Local (0.0.0.0:0) A similar question is saying this is caused by hosts file, but no detail.
alisondong
  • 141
  • 1
  • 5
13
votes
4 answers

Debugging/printing in a Hubot script

I'm trying to debug an existing Hubot script and in the future write my own, and I need an easy way to debug it or at least print values somewhere (but not to the channel). How can I do so? Bonus points if this can be done with just using Node in…
Artem Russakovskii
  • 20,170
  • 17
  • 87
  • 114
12
votes
2 answers

How do you 'mention' users in this hubot cron script for Slack, so they can see it as notification if their notification settings are on?

I have this hubot-cron script set up with heroku for Slack. Works great with one exception. If you '@' someone (mention) in Slack, users will get a notification depending on their notification settings. The way this is written, if put in a users…
user32763
  • 121
  • 1
  • 5
12
votes
2 answers

How to use Hubot in Slack

This seems like a stupid question. I have deployed Hubot to Heroku and set the configs given from Slack per this instruction. However I don't know if Hubot should show up as a member in my team or not. I can post a message via REST and the log says…
Khanetor
  • 9,495
  • 8
  • 31
  • 67
12
votes
2 answers

How do I combine multiple queries in ElasticSearch

For reference here is the code. I am trying to make a hubot plugin that logs to elasticsearch and then uses hubot commands to search those logs. https://gist.github.com/4050748 I am trying to retrieve records that match two queries. { query: { …
EnabrenTane
  • 7,294
  • 2
  • 24
  • 44
11
votes
1 answer

Detecting when a user leaves or enters a channel with hubot

I am trying to make Hubot detect when a user enters or leaves a channel, but so far I have been unable to actually find ANY information pertaining to this. Does anyone have any ideas of how to do this? :) Thanks in advance!
Eax
  • 3,456
  • 7
  • 22
  • 32
9
votes
1 answer

Remove Heroku setting from Hubot?

I tried running Hubot on Heroku, but I gave up because I'd prefer not to give out my credit card number. Instead, I tried running Hubot on my mac. It gave an error, like this: $ ./bin/hubot hubot-sample> [Fri Jun 05 2015 11:41:52 GMT+0900 (JST)]…
sutonea
  • 103
  • 1
  • 3
9
votes
3 answers

How to setup Hubot basic permissions?

How do I setup basic user permissions so users can't run commands like "Hubot die" or "Hubot show storage"? I can see there is a script called hubot-auth but that seems to be for implementing it in other scripts and not controlling existing…
digital
  • 1,869
  • 2
  • 22
  • 30
9
votes
1 answer

Calling one command from another

I want to do some kind of alias, for example, hubot status should call hubot newrelic me and hubot gauges for today. I tried to do things like `msg.send "hubot newrelic me", but seems like hubot just ignore the message. How can I do that?
caarlos0
  • 18,163
  • 21
  • 76
  • 144
1
2 3
18 19