fojas / cleverbot-node

Cleverbot client in node.js
MIT License
62 stars 33 forks source link

Getting <html> error, API down? #17

Closed ErraticFox closed 8 years ago

ErraticFox commented 8 years ago

I have it on my bot in Discord but I haven't used it, let alone, touched the command for cleverbot. Now I just get as a output.

avatarkava commented 8 years ago

The cleverbot code must be structured differently now (always wrapped in a prepare() statement). See the usage here: https://github.com/fojas/cleverbot-node

ErraticFox commented 8 years ago

I just checked and that's actually how I have it, excluding the tweaks to post stuff in my chat.

var cleverbot = require('cleverbot-node'),
    talkbot = new cleverbot

exports.talk = {
    talk(bot, msg, suffix) {
        cleverbot.prepare(function() {
            var conv = suffix
            talkbot.write(conv, function(response) {
                bot.reply(msg, `${response.message}`)
                console.log(response.message)
            })
        })
    }
}
fojas commented 8 years ago

Which version are you using? The older versions do not work anymore because of changes to cleverbot. The last few updates have just been for keeping up with those changes, so everything before the latest release is effectively broken.