hubot-fb icon indicating copy to clipboard operation
hubot-fb copied to clipboard

robot.messageRoom does not work.

Open waglik opened this issue 8 years ago • 0 comments

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

waglik avatar May 02 '16 10:05 waglik