hubot-pubsub
hubot-pubsub copied to clipboard
Subscribing to private messages is broken
Using the Slack Adapter for Hubot, whenever I try to subscribe to an event via a private message, the emit fails.
Debug messages:
[Thu Jun 11 2015 21:36:15 GMT+0000 (Coordinated Universal Time)] DEBUG Sending to C02FZLYR6: testevent1: blerg
[Thu Jun 11 2015 21:36:17 GMT+0000 (Coordinated Universal Time)] ERROR TypeError: Cannot call method 'send' of undefined
at SlackBot.send (D:\home\site\wwwroot\node_modules\hubot-slack\src\slack.coffee:206:17)
at Robot.send (D:\home\site\wwwroot\node_modules\hubot\src\robot.coffee:404:5)
at notify (D:\home\site\wwwroot\node_modules\hubot-pubsub\src\pubsub.coffee:67:15)
at TextListener.callback (D:\home\site\wwwroot\node_modules\hubot-pubsub\src\pubsub.coffee:132:13)
at TextListener.Listener.call (D:\home\site\wwwroot\node_modules\hubot\src\listener.coffee:27:8)
at Robot.receive (D:\home\site\wwwroot\node_modules\hubot\src\robot.coffee:197:31)
at SlackBot.Adapter.receive (D:\home\site\wwwroot\node_modules\hubot\src\adapter.coffee:66:12)
at SlackBot.message (D:\home\site\wwwroot\node_modules\hubot-slack\src\slack.coffee:154:8)
at Client.<anonymous> (D:\home\site\wwwroot\node_modules\hubot-slack\src\slack.coffee:1:1)
at Client.emit (events.js:95:17)
at Client.onMessage (D:\home\site\wwwroot\node_modules\hubot-slack\node_modules\slack-client\src\client.js:477:14)
at WebSocket.<anonymous> (D:\home\site\wwwroot\node_modules\hubot-slack\node_modules\slack-client\src\client.js:140:24)
at WebSocket.emit (events.js:98:17)
at Receiver.self._receiver.ontext (D:\home\site\wwwroot\node_modules\hubot-slack\node_modules\slack-client\node_modules\ws\lib\WebSocket.js:697:10)
at Receiver.opcodes.1.finish (D:\home\site\wwwroot\node_modules\hubot-slack\node_modules\slack-client\node_modules\ws\lib\Receiver.js:397:14)
at Receiver.expectHandler (D:\home\site\wwwroot\node_modules\hubot-slack\node_modules\slack-client\node_modules\ws\lib\Receiver.js:384:31)
at Receiver.add (D:\home\site\wwwroot\node_modules\hubot-slack\node_modules\slack-client\node_modules\ws\lib\Receiver.js:93:24)
at CleartextStream.firstHandler (D:\home\site\wwwroot\node_modules\hubot-slack\node_modules\slack-client\node_modules\ws\lib\WebSocket.js:678:22)
at CleartextStream.emit (events.js:95:17)
at CleartextStream.<anonymous> (_stream_readable.js:764:14)
at CleartextStream.emit (events.js:92:17)
at emitReadable_ (_stream_readable.js:426:10)
at _stream_readable.js:419:7
at process._tickCallback (node.js:419:13)
Trying my hand at coffeescript debugging to understand what's going on but haven't had much luck.
From the stack trace it fails when performing robot.send(user, message). Got to investigate how Slack adapter handles private messages.