Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

setUserId is not a function #1

Closed
beldar opened this issue Aug 28, 2017 · 4 comments
Closed

setUserId is not a function #1

beldar opened this issue Aug 28, 2017 · 4 comments
Assignees
Labels

Comments

@beldar
Copy link

beldar commented Aug 28, 2017

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:

  • Node v7.5.0
  • MacOS Sierra v10.12.6

What am I doing wrong?

Thanks

@cristiancavalli
Copy link
Contributor

Hey @beldar thanks for report looking into this now!

@cristiancavalli cristiancavalli self-assigned this Aug 28, 2017
cristiancavalli added a commit that referenced this issue Aug 28, 2017
Add setUserId to base message sink so interfaces
are congruent with examples.
@cristiancavalli
Copy link
Contributor

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

@cristiancavalli
Copy link
Contributor

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
Copy link
Author

beldar commented Aug 28, 2017

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

Thanks for the quick fix! 👌

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants