Skip to content
This repository has been archived by the owner. It is now read-only.
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
62 lines (55 sloc) 1.82 KB
# Description:
# Tell Hubot what you're working on so he can give out status updates when asked
# Dependencies:
# None
# Configuration:
# None
# Commands:
# hubot i am working on <anything> - Set what you're working on
# hubot what is everyone working on? - Find out what everyone is working on
# Author:
# beezee
module.exports = (robot) ->
robot.respond /(?:what\'s|what is|whats) @?([\w .\-]+) working on(?:\?)?$/i, (msg) ->
name = msg.match[1].trim()
if name is "you"
msg.send "I dunno, robot things I guess."
else if name.toLowerCase() is
msg.send "World domination!"
else if name.match(/(everybody|everyone)/i)
messageText = '';
users = robot.brain.users()
for k, u of users
if u.workingon
messageText += "#{} is working on #{u.workingon}\n"
messageText += ""
if messageText.trim() is "" then messageText = "Nobody told me a thing."
msg.send messageText
users = robot.brain.usersForFuzzyName(name)
if users.length is 1
user = users[0]
user.workingon = user.workingon or [ ]
if user.workingon.length > 0
msg.send "#{name} is working on #{user.workingon}."
msg.send "#{name} is slacking off."
else if users.length > 1
msg.send getAmbiguousUserText users
msg.send "#{name}? Who's that?"
robot.respond /(?:i\'m|i am|im) working on (.*)/i, (msg) ->
name =
user = robot.brain.userForName name
if typeof user is 'object'
user.workingon = msg.match[1]
msg.send "Okay #{}, got it."
else if typeof user.length > 1
msg.send "I found #{user.length} people named #{name}"
msg.send "I have never met #{name}"
You can’t perform that action at this time.