-
Notifications
You must be signed in to change notification settings - Fork 257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Intercepting Conversation answer to query database #24
Comments
You can do this in the after callback as you said, but you'll have to call Conversation on your own. middleware.after = function(message, conversationResponse, callback) {
// Call db
mydb.makeQuery(queryString, function(result) {
payload.context.dataToChange = result;
conversation.message(payload, function (err, response) {
callback(null, response);
});
});
} |
here is the test I did :
But, I don't receive any answer from Conversation or see log message in console... |
Sorry, should've said |
It's better, it nearly works, I can call Conversation and receive a new payload
But, even if response seems good ( console.log(response) ), the callback doesn't generate an answer to Messenger. |
[INFO] |
Is there no response coming back on Messenger or are you getting something outdated? If you want to change the response that's being sent back to Messenger, you have to update the
|
I was something outdated..
Now, i just have to really call DB. |
I'm trying to develop a bot using botkit-middleware-watson for FB messenger.
Dialog Conversation <-> Messenger runs good.
But now I want to intercept answer from Watson Conversation (event middleware.after ?), query a DB and answer directly to Conversation without using Messenger. Conversation will then interpret/format and answer to the user, using data retrieved from DB.
So my program have to (in event middleware.after ?)
Do you have any idea ?
The text was updated successfully, but these errors were encountered: