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 🙏

© 2024 – Pkg Stats / Ryan Hefner

node-red-contrib-discord-advanced

v3.6.0

Published

Recieve, send, edit, reply, react to and delete Discord messages, handle interactions and much more in Node-RED.

Downloads

476

Readme

node-red-contrib-discord-advanced

npm version

Node-red nodes that allow you to interact with Discord, via Discord.js.

Currently the following actions are supported:

  • Receive messages from any Discord servers your BOT is in.
  • Send messages in a specific channel.
  • Send private messages to users.
  • Send and edit embed messages.
  • Add attachments to messages.
  • Edit, reply, delete messages in a channel.
  • Publish messages to announcements channels.
  • React to messages with emojis.
  • Listen for reactions on a message.
  • Listen for interactions on a message button or select menu.
  • Listen for interactions on commands.
  • Submit modals.
  • Set Status text of the Bot
  • Get permissions of a specific user. Add and remove roles. Listen when a user joins or leaves a guild.
  • Change channel's name.
  • Allow full control over the BOT by access to the DiscordJS client.

This repository builds on node-red-contrib-discord by Joris vd Donk . The main intention is to add more features and keep the repository updated.

Installation and documentation

The Wiki is still being written when it comes to documentation but you can find a guide on how to install and setup the nodes here.

Nodes

node-red-contrib-discord-advanced gives you access to 13 nodes:

  • discordMessage is a node with no inputs and one output allowing you to receive notifications of incoming messages.
  • discordMessageManager allows (embed) messages to be sent to either channels or privatly to user. It also allows for editing and deleting of (embed) messages.
  • discordReactionManager that allows you to listen to reactions on a message.
  • discordPermissions allows you to check the permissions of a specifc user. This is useful when you get the user from another source than the discordMessage node. discorPermissions lets you to add role to an user and to remove role.
  • discordClient is an advanced deprecated node with one input and one output allowing you to inject a references to a Discord.js Client into a message. This node can cause node-red to crash if you use it improperly, so take caution. Messages containing a Discord.js Client reference can not be forked (e.g. sent to two nodes), so you'll have to manually remove the reference to the Client via a function node using delete msg.discord.
  • discordInteraction allows you to listen to commands, buttons and select menu interactions and to decide how to respond to them.
  • discordInteractionManager allows you to edit interactions by id.
  • discordChannelName allows you to change a channel's name.
  • discordMember listens when a user joins or leaves a guild.
  • discordTyping creates a 'bot is typing...' message on a channel.
  • discordEventManager allows you to create, delete, and get info events.
  • discordGuildManager allows you to get info about guilds and change name of of guilds.
  • discordCommandManager allows you to create, update and delete global application commands and guild application commands.

Changelog

See CHANGELOG.md for more info, including information regarding breaking changes per version.

Key migration points from 3.4.x to 3.5.0

Native behavior of discord interactions

When a command is sent by an user, discord displays messages like "Bot is thinking...". Versions < 3.4 of node-red-contrib-discord-advanced manage this interaction by replying with a default text message. From 3.5.0, this library always defers replies and updates, keeping in memory the reference to the interaction in order to interact moments later within the flow with the new node discordInteractionManager.

Replacing discordMessageManager for discordInteractionManager

Now all interactions are replied with discordInteractionManager node, so there are several scenarios for having in mind. This is a breaking change. It's mandatory to take a look on examples to prevent broken flows.

Examples

Privileged Intents for correct functioning

Support, issues and feature requests

For support in setting up and feature requests you can contact me on this discord. Issues can also be reported there but prefferably via GitHub.

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.