hubot-fb
hubot-fb copied to clipboard
robot.messageRoom does not work.
Hi
When I do robot.messageRoom it crashes with
TypeError: Cannot read property 'id' of undefined
at FBMessenger.send (../node_modules/hubot-fb/src/fb.coffee:35:9, <js>:45:37)
Quickly checking the hubot code I assume error lies in accessing envelope object.
So in robot.coffee :
messageRoom: (room, strings...) ->
user = { room: room }
@adapter.send user, strings...
while in fb.coffee :
send: (envelope, strings...) ->
@_sendText envelope.user.id, msg for msg in strings
I made quick fix that seems to fix the issue :
send: (envelope, strings...) ->
envelope = envelope.room
@_sendText envelope.user.id, msg for msg in strings