Skip to content

Found a couple of documentation bugs #223

Description

@pgoldweic

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions