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

n8n-nodes-discord-trigger-new

v0.19.0

Published

A node that triggers a workflow whenever a message from discord is sent.

Readme

n8n-nodes-discord-trigger

n8n.io - Workflow Automation

n8n nodes to trigger workflows from Discord messages.

This node utilizes a Discord bot to transmit or receive data from child processes when a node is executed. Fully updated and tested for 2025, with enhanced stability, cross-platform support, and advanced message handling features including debounce, cooldown, and multi-bot support.

n8n is a fair-code licensed workflow automation platform.

Installation
Bot Setup
Operations
Credentials
Compatibility
Usage
Version history

Installation

Follow the installation guide in the n8n community nodes documentation.

Bot Setup

To send, listen to messages, or fetch the list of channels or roles, you need to set up a bot using the Discord Developer Portal.

  1. Create a new application and set it up as a bot.
  2. Enable the Privileged Gateway Intents for Message Intent.
  3. Add the bot to your server with at least read channel permissions.

Operations

With this node, you can:

  • Listen to Discord chat messages (both server messages and direct messages).
  • React to messages with specific patterns or triggers.
  • Fetch lists of channels and roles.
  • Use message debounce and cooldown features to control trigger frequency.
  • Filter channels by category and manage disabled channels.
  • Control channel status (lock, unlock, archive, unarchive).
  • Send interactive confirmation messages with custom button labels.
  • Track guild member updates and role changes.
  • Handle multiple bot instances with multi-credential support.
  • NEW: Voice Channel Support - Record and process voice conversations.
  • NEW: Voice Activity Detection - Trigger workflows when users speak.
  • NEW: Audio Recording - Capture voice data in multiple formats (OGG, PCM, WebM).
  • NEW: Transcription Ready - Built-in support for speech-to-text services.

Credentials

You need to authenticate the node with the following credentials:

  • Client ID: The OAuth2 client ID of the Discord App.
  • Bot Token: The bot token of the Discord App.
  • n8n API Key: The API key of your n8n server.
  • Base URL: The API URL of your n8n instance (e.g., https://n8n.example.com/api/v1).

Refer to the official n8n documentation for more details.

Compatibility

  • Tested on n8n version 1.75.2
  • Fully compatible with 2025 n8n versions
  • Cross-platform support (Windows, Linux, macOS)

Usage

To use this node:

  1. Install it as a community node in your n8n instance.
  2. Configure the required credentials.
  3. Set up triggers for Discord messages based on your use case.

For more help on setting up n8n workflows, check the Try it out documentation.

Voice Recording with OpenAI Whisper Transcription

Step 1: Discord Voice Trigger Setup

  1. Add the Discord Voice Trigger node to your workflow
  2. Configure it with:
    • Select your Discord server
    • Choose voice channels to monitor
    • Enable "Auto-join voice channel"
    • Set Recording Format to "ogg" (default)
    • Optional: Enable "Save to File" for backup

Step 2: Convert Base64 Audio to Binary

Add a Function node after the Discord Voice Trigger with this code:

// Convert base64 audio to binary for OpenAI
const audioBase64 = $input.first().json.audioData;
const audioBuffer = Buffer.from(audioBase64, 'base64');

// Get metadata
const userName = $input.first().json.userName;
const duration = $input.first().json.duration;
const timestamp = new Date($input.first().json.timestamp);

// Create filename
const filename = `${userName}_${timestamp.getTime()}.ogg`;

// Return binary data for next node
return {
  json: {
    userName: userName,
    duration: duration,
    timestamp: timestamp,
    filename: filename
  },
  binary: {
    audio: {
      data: audioBuffer,
      mimeType: 'audio/ogg',
      fileName: filename
    }
  }
};

Step 3: OpenAI Whisper Transcription

Add an HTTP Request node with these settings:

Authentication:

  • Authentication: Predefined Credential Type
  • Credential Type: OpenAI API

Request:

  • Method: POST
  • URL: https://api.openai.com/v1/audio/transcriptions
  • Send Body: Form-Data/Multipart

Body Parameters: Add these form fields:

  1. file (Binary Data):

    • Parameter Type: Form Data
    • Name: file
    • Value: Binary Data
    • Input Data Field Name: audio
  2. model (String):

    • Parameter Type: Form Data
    • Name: model
    • Value: whisper-1
  3. response_format (String - Optional):

    • Parameter Type: Form Data
    • Name: response_format
    • Value: verbose_json (for timestamps) or text (simple)
  4. language (String - Optional):

    • Parameter Type: Form Data
    • Name: language
    • Value: tr (Turkish) or en (English)

Step 4: Process Transcription Result

Add another Function node to combine everything:

// Get transcription result
const transcription = $input.first().json;
const metadata = $input.all()[0].json;

// Create final output
return {
  json: {
    userName: metadata.userName,
    transcription: transcription.text || transcription,
    duration: metadata.duration,
    timestamp: metadata.timestamp,
    language: transcription.language || 'unknown',
    // If verbose_json format was used
    segments: transcription.segments || [],
    words: transcription.words || []
  }
};

Complete Workflow Example

[Discord Voice Trigger]
    ↓
[Function: Convert to Binary]
    ↓
[HTTP Request: OpenAI Whisper]
    ↓
[Function: Format Result]
    ↓
[Your Next Action: Save to Database, Send to Discord, etc.]

Alternative: Direct Base64 Method

If you prefer not to convert to binary, you can use a Code node to call OpenAI directly:

const audioBase64 = $input.first().json.audioData;
const audioBuffer = Buffer.from(audioBase64, 'base64');

// Create form data
const FormData = require('form-data');
const form = new FormData();

// Create a Blob from buffer
const blob = new Blob([audioBuffer], { type: 'audio/ogg' });
form.append('file', blob, 'audio.ogg');
form.append('model', 'whisper-1');
form.append('language', 'tr'); // or detect automatically

// Make API call
const response = await fetch('https://api.openai.com/v1/audio/transcriptions', {
  method: 'POST',
  headers: {
    'Authorization': `Bearer ${process.env.OPENAI_API_KEY}`
  },
  body: form
});

const result = await response.json();

return {
  json: {
    transcription: result.text,
    user: $input.first().json.userName,
    timestamp: new Date()
  }
};

Tips for Better Transcription:

  1. Audio Quality: The OGG/Opus format from Discord is good quality

  2. Language Setting: Specify language for better accuracy (tr for Turkish)

  3. Response Format Options:

    • text: Simple text output
    • json: Basic JSON with text
    • verbose_json: Includes timestamps and confidence scores
    • srt: Subtitle format
    • vtt: WebVTT subtitle format
  4. Cost Optimization:

    • Whisper costs $0.006 per minute
    • Filter short recordings (< 1 second) to save costs
    • Consider batching multiple short clips

Example Use Cases:

  • Meeting Transcription: Record and transcribe Discord voice meetings
  • Voice Commands: Transcribe voice to trigger bot commands
  • Content Moderation: Transcribe and analyze voice chat content
  • Translation: Use Whisper + GPT for real-time translation
  • Voice Notes: Convert voice messages to text for archiving

Version history

  • v0.13.0: Binary Audio Output - Voice trigger now outputs audio directly as n8n binary data. No Function node needed for conversion - audio is ready to use with HTTP Request node for OpenAI Whisper or other services.
  • v0.12.0: 🎉 Voice Recording Working! - Fix audio data serialization for IPC transfer. Convert audio buffer to base64 before sending through IPC to prevent [object Object] issues. Voice recording now fully functional with proper audio data capture.
  • v0.11.9: Fix voice receiver error handling - Correct error handler implementation for VoiceReceiver which doesn't extend EventEmitter. Add proper try-catch blocks and validation for receiver.speaking availability.
  • v0.11.8: Improve DAVE decryption error handling - Add graceful error handling for DAVE protocol decryption failures to prevent crashes and allow continued operation even when packets fail to decrypt.
  • v0.11.7: Add DAVE protocol support - Include @snazzah/davey and sodium-native dependencies for Discord's new voice encryption protocol (DAVE). Add comprehensive error handling for protocol-related issues.
  • v0.11.6: Critical fix - Enhance UDP IP discovery handling for voice connections. Add multiple fallback methods including manual IP discovery, forced Ready state transition, and automatic reconnection to resolve voice channel connection issues.
  • v0.11.0: Major update - Add Discord Voice Trigger node with voice recording, multi-format audio support, transcription-ready architecture, and global mutex/singleton system to prevent duplicate bot instances.
  • v0.10.12: Add global mutex/singleton pattern to prevent duplicate bot instances and event listeners on restart.
  • v0.10.11: Remove support command option and enhance support command handling in bot logic.
  • v0.10.10: Implement client cleanup on restart and add global cleanup handlers for process termination.
  • v0.10.9: Fix debounce and cooldown settings to use additionalFields for better organization.
  • v0.10.8: Add message debounce and cooldown features for Discord trigger node to control message frequency.
  • v0.10.7: Refactor DiscordTrigger cleanup to retain IPC connection for action nodes.
  • v0.10.6: Enhance IPC handling with timeout, connection checks, and improved callback management.
  • v0.10.4: Enhance IPC handling with timeout and improve message event structure.
  • v0.10.3: Fix Promise handling in DiscordInteraction node.
  • v0.10.2: Enhance DiscordInteraction to handle multiple messages and update bot action response logic.
  • v0.10.1: Add channel status actions (lock, unlock, archive, unarchive).
  • v0.10.0: Add support for category filtering and implement disabled channels management.
  • v0.8.3: Fix bot startup logic for Unix systems and prevent multiple bot starts.
  • v0.8.2: Add cross-platform IPC configuration for Windows, Linux, and macOS support.
  • v0.8.1: Multiple bug fixes and stability improvements.
  • v0.8.0: Add GuildMemberUpdate trigger, add option to rename confirm button choices.
  • v0.7.0: Add multiclient support. Multiple credentials across multiple workflows are now possible.
  • v0.6.0: Add direct message support (Thank you Fank).
  • v0.5.1: Add additional timeout field for confirmation message.
  • v0.5.0: Add a reaction trigger on messages, add attachments to message.
  • v0.4.0: Introduce additional trigger options, such as User joins guild, User leaves guild, Role created, Role deleted or Role updated.
  • v0.3.2: Update for multiple simultaneous trigger nodes with one bot.
  • v0.3.1: Added additional option to trigger node to trigger on other bot messages.
  • v0.3.0: Added option to require a reference message in order to trigger the node. Enhance interaction node with a confirmation node.
  • v0.2.9: Bug fix, where a message won't trigger when multiple trigger nodes are included.
  • v0.2.8: Multiple trigger nodes are now supported.
  • v0.2.7: A second node Discord Interaction is added to send a message with the same credentials. Additionally roles of users can be added or removed based on interaction.
  • v0.1.5: Initial release with message triggers and channel/role fetching capabilities.