Skip to content
Snippets Groups Projects
Unverified Commit 51570b06 authored by Diego Dorgam's avatar Diego Dorgam Committed by GitHub
Browse files

Merge pull request #36 from lappis-unb/fix-channel-interaction

Fix channel interaction
parents 252576dc 67dfeea7
No related branches found
No related tags found
No related merge requests found
......@@ -36,8 +36,8 @@ sendWithNaturalDelay = (msgs, elapsed = 0) ->
cb?()
, delay
createMatch = (text) ->
return res.message.text.match new RegExp('\\b' + text + '\\b', 'i')
createMatch = (text, pattern) ->
return text.match new RegExp('\\b' + pattern + '\\b', 'i')
module.exports = (_config, robot) ->
global.config = _config
......@@ -60,7 +60,8 @@ module.exports = (_config, robot) ->
# check if robot should respond
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)
actionHandler.takeAction(actionName, res)
# 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