google / chatbase-node

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

how to tell which fields aren't set? #38

Open dcsan opened 3 years ago

dcsan commented 3 years ago

since this library cannot take an object for options, we have to set all the props with functions is there a way to tell which properties are missing?

afaik all have been set

(node:38429) UnhandledPromiseRejectionWarning: Error: One or more required fields were not set on the message, please check the documentation on how to set the following message fields:
api_key, type, user_id, time_stamp, platform, message
    at MessageStateWrapper.exportCreatePayload (/Users/dc/dev/ten/xbot/server/node_modules/@google/chatbase/lib/MessageSink.js:430:14)
    at /Users/dc/dev/ten/xbot/server/node_modules/@google/chatbase/lib/MessageStateWrapper.js:145:29
    at new Promise (<anonymous>)

to make the library more usable:

otherwise it's just tedious trial and error to use this thing.