8

I can't seem to make this work, I'm just trying to print out the username of people who've just entered

robot.enter (msg) ->
   msg.send "#{msg.user.name}"
mu is too short
  • 426,620
  • 70
  • 833
  • 800
lemon
  • 9,155
  • 7
  • 39
  • 47

1 Answers1

26

I'd guess that you're looking at the wrong thing. The Hubot scripting interface isn't exactly documented but notify.coffee in the examples says this:

module.exports = (robot) ->
  robot.hear /@(\w+)/i, (msg) ->
    sender   = msg.message.user.name.toLowerCase()
    #...

So you probably want to look at msg.message instead of msg:

robot.enter (msg) ->
   msg.send "#{msg.message.user.name}"
mu is too short
  • 426,620
  • 70
  • 833
  • 800