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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@theredflag/n8n-nodes-custom-discord

v2.0.0

Published

Discord community node for getting all messages from channels with customizable rate limiting

Readme

Discord Get All Messages - n8n Community Node

A custom n8n community node package for retrieving all messages from Discord channels with advanced rate limiting and pagination control.

Features

  • Get All Messages: Retrieve all messages from any Discord channel your bot has access to
  • Customizable Rate Limiting: Control the delay between API requests to avoid hitting Discord's rate limits
  • Flexible Pagination: Support for pagination with before, after, and around message ID parameters
  • Response Simplification: Option to return simplified message data or full Discord API response
  • Built-in Error Handling: Graceful error handling with continue-on-fail support

Installation

Via n8n Community Nodes

  1. Go to Settings > Community Nodes in your n8n instance
  2. Click Install a community node
  3. Enter the package name: @theredflag/n8n-nodes-discord-purge
  4. Click Install

Via npm (for self-hosted n8n)

npm install @theredflag/n8n-nodes-discord-purge

Then restart your n8n instance.

Prerequisites

You need a Discord Bot Token to use this node. If you don't have one:

  1. Go to the Discord Developer Portal
  2. Create a new application
  3. Go to the "Bot" section
  4. Create a bot and copy the token
  5. Invite the bot to your server with appropriate permissions

Configuration

Credentials

This package includes the Discord Bot API credential type:

  • Bot Token: Your Discord bot's token (keep this secure!)

Node Parameters

Required Parameters

  • Channel ID: The ID of the Discord channel to fetch messages from

Optional Parameters

  • Return All: Whether to fetch all messages or limit the results (default: true)
  • Limit: Maximum number of messages to return when "Return All" is false (1-100, default: 50)

Advanced Options

  • After Message ID: Get messages after this specific message ID
  • Around Message ID: Get messages around this specific message ID
  • Before Message ID: Get messages before this specific message ID
  • Delay Between Requests (Ms): Time in milliseconds to wait between API requests (default: 1000ms)
  • Simplify Response: Return simplified message data instead of full Discord API response (default: true)

Usage Examples

Basic Usage - Get All Messages

  1. Add the "Discord Get All Messages" node to your workflow
  2. Configure your Discord Bot API credentials
  3. Enter the Channel ID (e.g., 123456789012345678)
  4. Set "Return All" to true
  5. Execute the workflow

Rate-Limited Bulk Retrieval

For large channels, use a longer delay to avoid rate limits:

  1. Set "Delay Between Requests (Ms)" to 2000 (2 seconds)
  2. This helps when fetching thousands of messages from active channels

Paginated Retrieval

To get messages from a specific time range:

  1. Set "Before Message ID" to a message ID from your end date
  2. Set "After Message ID" to a message ID from your start date
  3. This will fetch messages between those two points

Output Data

Simplified Response (default)

When "Simplify Response" is enabled, each message contains:

  • id: Message ID
  • channel_id: Channel ID where the message was sent
  • author: Author information (user object)
  • content: Message text content
  • timestamp: When the message was created
  • type: Message type
  • attachments: File attachments
  • embeds: Rich embeds
  • reactions: Message reactions
  • mentions: User/role mentions
  • edited_timestamp: When the message was last edited (if applicable)

Full Response

When "Simplify Response" is disabled, you get the complete Discord API message object with all fields.

Rate Limiting

Discord has strict rate limits:

  • Global: 50 requests per second across all endpoints
  • Per-channel: Varies by endpoint, typically 5-10 requests per second

This node includes built-in rate limiting:

  • Default 1-second delay between requests
  • Respects Discord's rate limit headers
  • Automatically handles rate limit responses

For very large channels (10k+ messages), consider:

  • Increasing delay to 2-3 seconds
  • Running during off-peak hours
  • Using pagination to process in chunks

Permissions Required

Your Discord bot needs the following permissions in the target channel:

  • Read Messages (VIEW_CHANNEL)
  • Read Message History (READ_MESSAGE_HISTORY)

Limitations

  • Maximum 100 messages per API request (Discord limitation)
  • Historical message limit depends on Discord's retention policy
  • Bot can only access channels it has permissions for
  • Rate limits may slow down large bulk operations

Troubleshooting

Common Issues

"Missing Permissions" Error

  • Ensure your bot has the required permissions in the target channel
  • Check that the bot is actually in the server/channel

Rate Limit Errors

  • Increase the "Delay Between Requests" value
  • Consider running during off-peak hours

Invalid Channel ID

  • Right-click the channel in Discord and select "Copy ID"
  • Ensure Developer Mode is enabled in Discord settings

Empty Results

  • Check if the channel has any messages
  • Verify the bot can see the channel
  • Check if using pagination parameters correctly

Getting Channel IDs

  1. Enable Developer Mode in Discord (User Settings > Advanced > Developer Mode)
  2. Right-click on the channel name
  3. Select "Copy ID"

Support

If you encounter issues or have questions:

  1. Check the n8n community forum
  2. Report bugs via the GitHub repository

License

MIT License - see LICENSE file for details.

Contributing

Contributions are welcome! Please feel free to submit pull requests or open issues on the GitHub repository.