npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

node-red-contrib-discordjs

v1.0.4

Published

Node-RED node using DiscordJs

Downloads

17

Readme

node-red-contrib-discord

Node-red nodes that allow you to interact with Discord, via Discord.js. Currently, you can write simple request-reply bots with this. Though node-red-contrib-discordjs is production ready for small bots, it's a new project that might be difficult to use for those unfamiliar with Discord.js. It also hasn't been used yet for large Discord bot deployments.

Warning : nodejs >= 14.0.0 is required to run discordjs v12.

Installation

We recommend to install it with the node-red palette manager.

Run the following command in ~/.node-red:

npm install node-red-contrib-discordjs

Nodes

node-red-contrib-discord gives you access to three nodes:

  • Connect is a node with no inputs and one output allowing you to receive notifications of incoming messages.
  • SendMessage is a node with one input and no outputs allowing you to send messages to a Discord channel.
  • Sendembed is a node with one input and no outputs allowing you to send embed messages to a Discord channel.

Discord.js client sharing

All nodes share Discord.js clients based on the discord-token that they were configured with. That means that, when you add many discordMessage nodes configured with the exact same token, only a single connection with Discord will be made.

Example bot

[{"id":"7cd3ec8e.612e24","type":"tab","label":"Discord","disabled":false,"info":""},{"id":"aa80ad21.68c96","type":"discord-token","name":"NODE-RED"},{"id":"192a1ae0.f96c55","type":"switch","z":"7cd3ec8e.612e24","name":"Delimiter !","property":"payload[0]","propertyType":"msg","rules":[{"t":"cont","v":"!","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":420,"y":340,"wires":[["267ccf64.0ce78"]]},{"id":"64ff274e.1d9f68","type":"change","z":"7cd3ec8e.612e24","name":"Say Morning","rules":[{"t":"set","p":"payload","pt":"msg","to":"morning !","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":890,"y":340,"wires":[["8a81a3a0.6c6f7"]]},{"id":"a5096981.aecb98","type":"Connect","z":"7cd3ec8e.612e24","name":"","token":"aa80ad21.68c96","x":180,"y":340,"wires":[["192a1ae0.f96c55"]]},{"id":"8a81a3a0.6c6f7","type":"sendMessage","z":"7cd3ec8e.612e24","name":"","channel":"","token":"aa80ad21.68c96","x":1180,"y":460,"wires":[]},{"id":"267ccf64.0ce78","type":"switch","z":"7cd3ec8e.612e24","name":"Switch","property":"payload","propertyType":"msg","rules":[{"t":"cont","v":"hello","vt":"str"},{"t":"cont","v":"salut","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":630,"y":340,"wires":[["64ff274e.1d9f68"],["80eea92c.c81608"],["6c7e663e.3cc9a8"]]},{"id":"80eea92c.c81608","type":"change","z":"7cd3ec8e.612e24","name":"Say Bonjour","rules":[{"t":"set","p":"payload","pt":"msg","to":"Bonjour !","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":890,"y":400,"wires":[["8a81a3a0.6c6f7"]]},{"id":"6c7e663e.3cc9a8","type":"change","z":"7cd3ec8e.612e24","name":"Unknown Command","rules":[{"t":"set","p":"payload","pt":"msg","to":"Unknown Command !","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":520,"y":440,"wires":[["7db8adeb.f9e6f4"]]},{"id":"7db8adeb.f9e6f4","type":"sendEmbed","z":"7cd3ec8e.612e24","name":"Unknown Command","channel":"","title":"t","color":"","description":"test","token":"aa80ad21.68c96","x":520,"y":520,"wires":[]}]