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

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

@dcsan

Description

@dcsan

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:

  • error messages should be more precise - what fields weren't set?
  • allow to set all options eg msg.setOptions(opts)
  • at least inspect the options that are set? const obj = msg.getOptions()

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

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