nandub / hubot-irc

IRC adapter for Hubot
MIT License
299 stars 128 forks source link

Adapter doesn't work with robot.messageRoom #173

Closed phily245 closed 6 years ago

phily245 commented 6 years ago

When you attempt to call robot.messageRoom room message from hubot whilst using this adapter, there is a TypeError as it can't find the _getTargetFromEnvelope function in the current scope. Here's the stack trace:

TypeError: this._getTargetFromEnvelope is not a function
 at Robot.IrcBot.send (/path/to/hubot/node_modules/hubot-irc/src/irc.coffee:20:14, <js>:48:21)
 at Robot.messageRoom (/path/to/hubot/node_modules/hubot/src/robot.js:608:23)
 at robot.router.post (/path/to/hubot/scripts/simon-says.js:58:7)
 at callbacks (/path/to/hubot/node_modules/express/lib/router/index.js:164:37)
 at param (/path/to/hubot/node_modules/express/lib/router/index.js:138:11)
 at pass (/path/to/hubot/node_modules/express/lib/router/index.js:145:5)
 at Router._dispatch (/path/to/hubot/node_modules/express/lib/router/index.js:173:5)
 at Object.router (/path/to/hubot/node_modules/express/lib/router/index.js:33:10)
 at next (/path/to/hubot/node_modules/connect/lib/proto.js:174:15)
 at Object.multipart [as handle] (/path/to/hubot/node_modules/connect-multiparty/index.js:42:27)
 at next (/path/to/hubot/node_modules/connect/lib/proto.js:174:15)
 at Object.urlencodedParser [as handle] (/path/to/hubot/node_modules/body-parser/lib/types/urlencoded.js:81:44
 at next (/path/to/hubot/node_modules/connect/lib/proto.js:174:15)
 at /path/to/hubot/node_modules/body-parser/lib/read.js:121:5
 at invokeCallback (/path/to/hubot/node_modules/raw-body/index.js:262:16)
 at done (/path/to/hubot/node_modules/raw-body/index.js:251:7)
 at IncomingMessage.onEnd (/path/to/hubot/node_modules/raw-body/index.js:307:7)
 at emitNone (events.js:106:13)
 at IncomingMessage.emit (events.js:208:7)
 at endReadableNT (_stream_readable.js:1055:12)
 at _combinedTickCallback (internal/process/next_tick.js:138:11)
 at process._tickCallback (internal/process/next_tick.js:180:9)<br>

I suspect as this function isn't defined in the adapter, the scope may be on the robot object? Using hubot v3.0.1.