google / chatbase-node

Quickly integrate your Node.js chatbot with Chatbase Analytics
Apache License 2.0
78 stars 24 forks source link

setUserId is not a function #1

Closed beldar closed 7 years ago

beldar commented 7 years ago

Trying to use this library and keep getting this error, my code looks like this:

chatbase.newMessage()
      .setAsTypeUser()
      .setPlatform(event.address.channelId)
      .setVersion(version)
      .setTimestamp(new Date(event.timestamp).getTime())
      .setMessage(event.text)
      .setUserId(event.address.user.id || event.user.id)
      .send()
      .then(msg => console.log(msg.getCreateResponse()))
      .catch(err => console.error(err));

Error I get is:

TypeError: chatbase.newMessage(...).setAsTypeUser(...).setPlatform(...).setVersion(...).setTimestamp(...).setMessage(...).setUserId is not a function

Running this on:

What am I doing wrong?

Thanks

cristiancavalli commented 7 years ago

Hey @beldar thanks for report looking into this now!

cristiancavalli commented 7 years ago

@beldar Issue is fixed on master, will release an update to the NPM package and ping this thread.

cristiancavalli commented 7 years ago

The fix is now uploaded to the package on NPM: https://www.npmjs.com/package/@google/chatbase Version: 0.0.2

Please re-open this issue if this did not fix the issue you were having. Thanks again for reporting this!

beldar commented 7 years ago

It did fix this issue, other ones have sprung up, but I'll open other tickets for them.

Thanks for the quick fix! 👌