Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

not calling next() if empty message recieved #1

Open
Stevenic opened this issue Mar 31, 2016 · 1 comment
Open

not calling next() if empty message recieved #1

Stevenic opened this issue Mar 31, 2016 · 1 comment

Comments

@Stevenic
Copy link

Doubt it will happen but you should probably call next() if you don't have message,text

middleware.receive = function(bot, message, next) {
    if (message.text) {
        wit.captureTextIntent(config.token, message.text, function(err, res) {
            if (err) {
                next(err);
            } else {
                console.log(JSON.stringify(res));
                message.intents = res.outcomes;
                next();
            }
        });
    }

};
@benbrown
Copy link
Contributor

Doh! Good catch.

brianjd added a commit to brianjd/botkit-middleware-witai that referenced this issue Jul 11, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants