jellyfangs/messenger-bot-witai-tutorial

Unable to call function

crosofg opened this issue · 1 comments

I have uncommented the fetch-weather action section from the code

    },

    // list of functions Wit.ai can execute
    ['fetch-weather'](sessionId, context, cb) {
        // Here we can place an API call to a weather service
        console.log("***********************Called ");
         if (context.loc) {
            getWeather(context.loc)
                .then(function (forecast) {
                    context.forecast = forecast || 'sunny'
                })
                .catch(function (err) {
                    console.log(err)
                })
         }

        context.forecast = 'Sunny';

        cb(context)
    },

the Error

2016-06-30T13:07:43.566415+00:00 app[web.1]: oops! No '
2016-06-30T13:07:43.566427+00:00 app[web.1]: fetch-weather
2016-06-30T13:07:43.566449+00:00 app[web.1]:   ' action found.

image

What is wrong here?

Silly mistake. Variable names different