Skip to content

Commit

Permalink
Fixed cleverbot
Browse files Browse the repository at this point in the history
  • Loading branch information
bonnici committed Jul 20, 2015
1 parent 0eae3fb commit f2f53b6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 131 deletions.
10 changes: 6 additions & 4 deletions lib/triggers/cleverbotTrigger.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,12 @@ CleverbotTrigger.prototype._respond = function(toId, message) {
if (message) {
this.cleverbot.params.sessionid = this.session; // Reset session in case it gets set to DENIED
var that = this;
this.cleverbot.write(message, function(response) {
if (response.message != '<html>' && response.message.trim() != '' && response.message.indexOf("Error:") != 0) {
that._sendMessageAfterDelay(toId, response.message.trim());
}
Cleverbot.prepare(function() {
that.cleverbot.write(message, function(response) {
if (response.message != '<html>' && response.message.trim() != '' && response.message.indexOf("Error:") != 0) {
that._sendMessageAfterDelay(toId, response.message.trim());
}
});
});

return true;
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
, "winston": "1.0.x"
, "sinon": "1.14.x"
, "nock": "1.7.x"
, "cleverbot-node": "0.1.x"
, "cleverbot-node": "0.2.x"
, "wolfram": "0.3.x"
, "tumblr.js": "0.0.x"
, "youtube-node": "1.2.x"
Expand Down
126 changes: 0 additions & 126 deletions spec/wolframAlphaTriggerSpec.js

This file was deleted.

0 comments on commit f2f53b6

Please sign in to comment.