custom-discord

Enhanced Discord node for n8n with improved rate limiting and error handling

Package Information

Released: 13 mo ago
Downloads: 14 weekly / 26 monthly
Latest Version: 1.0.5
Author: The Red Flag

Documentation

n8n-nodes-custom-discord

npm version
License: MIT

An enhanced Discord community node for n8n with improved rate limiting and error handling capabilities.

Features

🚀 Enhanced Rate Limiting

  • Configurable Request Delays: Set custom delays between API requests
  • Automatic Retry Logic: Built-in retry mechanism with exponential backoff
  • Smart Rate Limit Handling: Respects Discord's API rate limits automatically

🛡️ Improved Error Handling

  • Graceful Error Recovery: Fixed critical error handling bugs in the original node
  • Better Error Messages: More informative error messages for debugging
  • Robust Request Processing: Enhanced reliability for large-scale operations

📨 All Original Features

  • Send messages to channels and users
  • Manage embeds, attachments, and components
  • Support for webhooks, bot tokens, and OAuth2
  • Full compatibility with existing Discord workflows

Installation

Install the community node package in your n8n instance:

npm install n8n-nodes-custom-discord

Or install via the n8n UI:

  1. Go to Settings → Community Nodes
  2. Enter: n8n-nodes-custom-discord
  3. Click Install

Configuration

Rate Limiting Options

When using the "Get All Messages" operation, you can configure:

  • Time Between Requests (default: 1000ms): Delay between consecutive API calls
  • Max Retry Attempts (default: 3): Maximum number of retry attempts on error
  • Retry Delay (default: 2000ms): Delay between retry attempts

Example Configuration for Heavy Usage:

{
  "timeBetweenRequests": 2000,
  "maxRetries": 5,
  "retryDelay": 3000
}

Usage

The Custom Discord node appears in your node palette as "Custom Discord" and works identically to the built-in Discord node, with additional configuration options for enhanced reliability.

Basic Message Sending

  1. Add the Custom Discord node to your workflow
  2. Configure your Discord credentials (Bot Token, OAuth2, or Webhook)
  3. Set the channel/user and message content
  4. Execute the workflow

Advanced Message Retrieval

  1. Select "Message" resource and "Get All" operation
  2. Configure the channel to retrieve messages from
  3. Set your rate limiting preferences in the Options section
  4. The node will automatically handle pagination and rate limits

Compatibility

  • n8n version: 1.0.0 and above
  • Node.js version: 18.x and above
  • Backward compatibility: Full compatibility with existing Discord workflows

Credentials

This node uses the same credential types as the built-in Discord node:

  • Discord Bot API
  • Discord OAuth2 API
  • Discord Webhook API

Key Improvements Over Built-in Node

  1. Fixed Error Handling: Resolved crashes when Discord API returns malformed error responses
  2. Enhanced Rate Limiting: Configurable delays and retry logic for better API compliance
  3. Improved Reliability: Better handling of network issues and API timeouts
  4. Detailed Logging: More informative error messages for easier debugging

Contributing

This is an open-source community node. Contributions are welcome!

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

Support

License

MIT License - see the LICENSE file for details.

Changelog

v1.0.0

  • Initial release
  • Fixed error handling in parseDiscordError function
  • Added configurable rate limiting to message retrieval
  • Enhanced retry logic with exponential backoff
  • Full compatibility with n8n Discord workflows

Discussion