Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to send a message to discord? #4

Open
pratham2003 opened this issue Apr 25, 2020 · 1 comment
Open

How to send a message to discord? #4

pratham2003 opened this issue Apr 25, 2020 · 1 comment

Comments

@pratham2003
Copy link

pratham2003 commented Apr 25, 2020

Hi,

I have a simple flow.
Discord-In -> Message -> Discord-out
I'm getting this error.

PrettyJSON error

-- RELAY MESSAGE --
{ There is a valid parsed version of the JSON object here }

I'm not sure why the console says PrettyJSON error

(node:21308) UnhandledPromiseRejectionWarning: TypeError: Cannot assign to read only property 'writeQueueSize' of object '#<TCP>'

@pratham2003
Copy link
Author

pratham2003 commented Apr 27, 2020

For the PrettyJSON error it's was mostly related to a circular reference.

I replaced PrettyJSON with prettyoutput which has a max-depth limit.
It works.

UnhandledPromiseRejectionWarning was thrown by node-red's debug module.

Update:
So these errors were related to cloning the payload.
at _clone in node-red\node_modules\clone\clone.js

I realized the reason node-red was trying to clone the payload was because I had the link setup this way

graph TD
  DR[Discord Receiver]
  DS[Discord Sender]
  SW[Switch]
  TXT[Text]
  DBG[Debug]

  DR --> SW
  SW --> TXT
  TXT --> DS

  DR --> DBG
Loading

P.S. Github doesn't have MermaidJS support yet?

I guess the reason it had to 'clone' the message was because I was connecting the Discord Sender to two endpoints.

The error was produced only when I attached the Debug to Discord Sender which initially lead me to believe it was an issue related to debug specifically but after disconnecting DR --> SW the Debug module worked.

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

No branches or pull requests

1 participant