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

Merge pull request #38 from lappis-unb/fix_missing_error_nodes

Fix crash with missing error nodes and high trust value
parents 51570b06 98d23251
No related branches found
No related tags found
No related merge requests found
......@@ -21,10 +21,17 @@ actionHandler.registerActions = (config) ->
if name.substr(0, 5) == "error"
err_nodes++
if err_nodes == 0
console.log("WARNING! You don't have any error nodes, you need at least " +
"one to garantee that the bot always will respond something")
actionHandler.errorNodesCount = () ->
return err_nodes
actionHandler.takeAction = (name, res) ->
nodes[name].process(res)
if not name?
res.sendWithNaturalDelay "I'm sorry Dave, I'm afraid I can't do that =/"
else
nodes[name].process(res)
module.exports = actionHandler
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