Cannot call method 'speak' of undefined
Closed this issue · 1 comments
When process receives message from slack, it gets a runtime error with "Cannot call method 'speak' of undefined".
tracestack
/home/jalen/IRC_BOT/sdnds/fntsrlike/slack-irc-plugin/lib/slack2irc.js:72
this.slackbot.speak(channel, message);
^
TypeError: Cannot call method 'speak' of undefined
at Slack2IRC._sentMessage (/home/jalen/IRC_BOT/sdnds/fntsrlike/slack-irc-plugin/lib/slack2irc.js:72:17)
at null. (/home/jalen/IRC_BOT/sdnds/fntsrlike/slack-irc-plugin/lib/slack2irc.js:53:12)
at IncomingMessage.emit (events.js:95:17)
at IncomingMessage. (stream_readable.js:765:14)
at IncomingMessage.emit (events.js:92:17)
at emitReadable (_stream_readable.js:427:10)
at emitReadable (_stream_readable.js:423:5)
at readableAddChunk (_stream_readable.js:166:9)
at IncomingMessage.Readable.push (_stream_readable.js:128:10)
at HTTPParser.parserOnBody as onBody
Here I found the problem.
Cause slackbot
is not appear in slack2irc.js
, this.slackbot
keeps undefined
.
I just changed it to ircBot
to speak in IRC, that I thought it's the original think of this action.