Skip to content
Snippets Groups Projects
Commit 67dfeea7 authored by Matheus Faria's avatar Matheus Faria
Browse files

Fix missing res on channel interaction

parent b16e3b60
No related branches found
No related tags found
No related merge requests found
...@@ -36,8 +36,8 @@ sendWithNaturalDelay = (msgs, elapsed = 0) -> ...@@ -36,8 +36,8 @@ sendWithNaturalDelay = (msgs, elapsed = 0) ->
cb?() cb?()
, delay , delay
createMatch = (text) -> createMatch = (text, pattern) ->
return res.message.text.match new RegExp('\\b' + text + '\\b', 'i') return text.match new RegExp('\\b' + pattern + '\\b', 'i')
module.exports = (_config, robot) -> module.exports = (_config, robot) ->
global.config = _config global.config = _config
...@@ -60,7 +60,8 @@ module.exports = (_config, robot) -> ...@@ -60,7 +60,8 @@ module.exports = (_config, robot) ->
# check if robot should respond # check if robot should respond
if res.envelope.user.roomType in ['c', 'p'] if res.envelope.user.roomType in ['c', 'p']
if (createMatch(res.robot.name)) or (createMatch(res.robot.alias)) if (createMatch(res.message.text, res.robot.name) or
createMatch(res.message.text, res.robot.alias))
actionName = classifier.processMessage(res, msg) actionName = classifier.processMessage(res, msg)
actionHandler.takeAction(actionName, res) actionHandler.takeAction(actionName, res)
# TODO: Add engaged user conversation recognition/tracking # TODO: Add engaged user conversation recognition/tracking
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment