"source.on is not a function" for discord.js

Describe the issue/error/question

When catching a webhook, I can separate sections from it properly now. I figured out how to pass the parameters on to the content, but now I am having the issue of a function being called that does not exist on the backend.

What is the error message (if any)?

Problem executing workflow
There was a problem executing the workflow:
"source.on is not a function"

Please share the workflow

Share the output returned by the last node

{
  "allowed_mentions": {
    "parse": [
      "roles"
    ],
    "roles": [
      "ChangeLog"
    ]
  },
  "embeds": [
    {
      "type": "rich",
      "title": "DiscordIntergration",
      "description": "Racer540 just commited a new update! Coming Soon™!",
      "fields": [
        {
          "name": "Commit Message:",
          "value": "README.md edited online with Bitbucket"
        }
      ],
      "thumbnail": {
        "url": "https://bytebucket.org/ravatar/%7Bb41fabe1-e7d8-44f3-8729-53834727a1c9%7D?ts=default",
        "height": 0,
        "width": 0
      }
    }
  ]
}

Information on your n8n setup

  • n8n version: Latest (Updated to make sure this wasn’t an issue)
  • Database you’re using (default: SQLite): Default
  • Running n8n with the execution process [own(default), main]: Own
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]: Docker

Hi @Racer, welcome to the community!

It seems your example payload is invalid, even when sent to Discord completely outside of n8n:

So you would need to build a valid payload first, for example something like

{
    "username": "n8n 🚀",
    "embeds": [{
        "type": "rich",
        "title": "n8n@123456 is now available",
        "color": 16739674,
        "url": "https://github.com/n8n-io/n8n/blob/master/CHANGELOG.md"
    }]
}

That said, I couldn’t get the Discord node to like that payload either, despite being valid :expressionless:. So I ended up using the HTTP Request node to get the job done:

Hope this helps!