You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, as I'm migrating from an older version of this middleware to 2.0.1, I've noticed what appear to be a couple of documentation bugs to me (in the readme file), as follows:
1- Everywhere where 'message_received' is used, should become 'message' (this is a Botkit change)
2- The middleware :before and :after signatures appear to be incorrect. I have only tested the 'after' method and not the
'before', but I suspect that the same problem might apply to both. Specifically, instead of being:
middleware.after = (message, assistantResponse) => async () => {
// Code here gets executed after the call to Assistant.
return assistantResponse;
});
we really want it to be:
middleware.after = async (message, assistantResponse) => {
// Code here gets executed after the call to Assistant.
return assistantResponse;
});
(note the difference in signatures above for item #2). Following the signature used in the docs, my bot would be essentially mute, and 'watsonData' in a message ended up having as value the async function itself (odd), while the second signature (more in line with the one used in earlier versions) produces bot responses as expected.
The text was updated successfully, but these errors were encountered:
Hi, as I'm migrating from an older version of this middleware to 2.0.1, I've noticed what appear to be a couple of documentation bugs to me (in the readme file), as follows:
(note the difference in signatures above for item #2). Following the signature used in the docs, my bot would be essentially mute, and 'watsonData' in a message ended up having as value the async function itself (odd), while the second signature (more in line with the one used in earlier versions) produces bot responses as expected.
The text was updated successfully, but these errors were encountered: