Workflows
Blocks
Integrations
Discord

Discord Action Block

What it does: Send messages, manage channels, assign roles, moderate members, and interact with your Discord server directly from your workflows.

🎯

In simple terms: Connect your Discord server bot to automate notifications, team alerts, moderation actions, and community management — all triggered by your workflow logic.

When to Use This

Use the Discord action when you need to:

  • ✅ Send automated notifications to Discord channels (deployments, alerts, reports)
  • ✅ Assign or remove roles when users complete actions in other systems
  • ✅ Create or delete channels dynamically based on workflow events
  • ✅ Post webhook messages to channels without a full bot
  • ✅ Read channel history for moderation or analytics
  • ✅ Manage server members programmatically

Example: When a new customer signs up, add them to a "customers" Discord role and post a welcome message in #new-members.

Features

  • Messaging: Send messages, get messages, list channel history, delete messages
  • Channel Management: Create, update, delete, and list channels
  • Role Management: Add and remove roles from members
  • Member Management: List server members
  • Webhooks: Send messages via Discord webhook URLs (no bot required)
  • Variable Support: Use {{variables}} in any message field

Getting Your Discord Bot Token

Discord uses Bot Tokens for authentication.

Step 1 — Create a Discord Application

  1. Go to the Discord Developer Portal (opens in a new tab)
  2. Click New Application
  3. Give your bot a name (e.g., InditeAI Bot) and click Create

Step 2 — Create a Bot User

  1. In your application, go to the Bot tab in the left sidebar
  2. Click Add BotYes, do it!
  3. Under the Token section, click Reset Token
  4. Copy the token immediately — you cannot view it again after leaving the page
⚠️

Keep your bot token private. Anyone with this token can control your bot and interact with servers it has joined. Never commit it to source code.

Step 3 — Set Bot Permissions

  1. Still in the Bot tab, scroll down to Bot Permissions
  2. Enable the permissions your workflows need:
    • Send Messages — required for all messaging actions
    • Read Message History — required for Get/List Messages
    • Manage Channels — required for Create/Delete/Update Channel
    • Manage Roles — required for Add/Remove Role
    • Manage Messages — required for Delete Message
  3. Note the Privileged Gateway Intents — enable Server Members Intent if you need List Members

Step 4 — Invite the Bot to Your Server

  1. Go to OAuth2URL Generator in the left sidebar
  2. Check bot under Scopes
  3. Check the permissions you enabled in Step 3
  4. Copy the generated URL and open it in your browser
  5. Select your Discord server and click Authorize

Step 5 — Get Your Server (Guild) ID

  1. In Discord, go to User SettingsAdvanced → enable Developer Mode
  2. Right-click your server name → Copy Server ID

Step 6 — Connect in InditeAI

  1. Add the Discord action block to your workflow
  2. Click Select CredentialsCreate New
  3. Paste your Bot Token
  4. Click Save Credentials

Setup in InditeAI

1. Connect Your Bot

Follow the credential steps above. Once connected, select your credentials from the dropdown.

2. Select an Action

CategoryActions
MessagingSend Message, Get Message, List Messages, Delete Message
ChannelsGet Channel, List Channels, Create Channel, Update Channel, Delete Channel
Members & RolesAdd Role, Remove Role, List Members
WebhooksSend Webhook

3. Configure Fields

Most actions require the Server ID (Guild ID) and Channel ID. See sections below.

Messaging

Send Message

Sends a text message to a Discord channel.

Server ID (Guild ID) (required): Your Discord server ID

123456789012345678
{{trigger.guildId}}

Channel ID (required): The channel to post to

987654321098765432
{{trigger.channelId}}

Message Content (required): The message text — supports {{variables}}

New deployment completed! Version {{release.tag}} is now live.
Hey {{trigger.username}}, your request has been processed.
💡

Getting Channel IDs: With Developer Mode enabled, right-click any channel in Discord → Copy Channel ID.

Get Message

Retrieves a specific message by ID.

Channel ID (required): Channel containing the message

Message ID (required):

{{trigger.messageId}}
111222333444555666

Returns: id, content, author, timestamp, attachments, embeds

List Messages

Retrieves the most recent messages from a channel.

Channel ID (required): Channel to read from

Limit (optional): Number of messages to return (default 50, max 100)

20
{{trigger.limit}}

Delete Message

Permanently deletes a message from a channel.

Channel ID (required): Channel containing the message

Message ID (required): ID of the message to delete

{{message.id}}
⚠️

Bots can only delete their own messages unless they have the Manage Messages permission. Deleted messages cannot be recovered.

Channel Management

Get Channel

Retrieves details for a specific channel.

Channel ID (required): 987654321098765432

Returns: id, name, type, topic, position, guild_id

List Channels

Lists all channels in your Discord server.

Server ID (required): Your server ID

Returns: Array of all channels with id, name, type, topic

Create Channel

Creates a new channel in your server.

Server ID (required): Your server ID

Channel Name (required): Name for the new channel

general-chat
{{trigger.channelName}}
project-{{project.name}}

Channel Type (optional): 0 = text channel, 2 = voice channel (default: text)

Topic (optional): Channel description

Discussion for {{project.name}} project

Update Channel

Updates an existing channel's name or topic.

Channel ID (required): Channel to update

Channel Name (optional): New name for the channel

Topic (optional): New channel description

Delete Channel

Permanently removes a channel from your server.

Channel ID (required): Channel to delete

⚠️

Channel deletion is permanent and cannot be undone. All messages in the channel are lost.

Role Management

Add Role

Assigns a role to a server member.

Server ID (required): Your server ID

User ID (required): Discord user ID of the member

{{trigger.userId}}
{{member.discordId}}

Role ID (required): ID of the role to assign

{{role.premiumId}}
555666777888999000
💡

Getting Role IDs: In Discord server settings → Roles → right-click a role → Copy Role ID (requires Developer Mode).

Remove Role

Removes a role from a server member.

Server ID (required): Your server ID

User ID (required): Discord user ID of the member

Role ID (required): ID of the role to remove

List Members

Returns a list of members in your Discord server.

Server ID (required): Your server ID

Limit (optional): Number of members to return (default 100)

Returns: Array of member objects with user.id, user.username, roles, joined_at

⚠️

List Members requires the Server Members Intent to be enabled in your bot's settings in the Discord Developer Portal.

Webhooks

Send Webhook

Sends a message via a Discord webhook URL. No bot credentials needed — just a webhook URL.

Webhook URL (required): The Discord webhook URL

https://discord.com/api/webhooks/123/abc...
{{env.discordWebhookUrl}}

Message Content (required): Message text — supports {{variables}}

Alert: {{alert.message}}
Build status: {{build.status}} for {{build.branch}}
💡

Creating Webhook URLs: In Discord → channel settings → Integrations → Webhooks → New Webhook → Copy Webhook URL. This is the simplest way to post messages without setting up a full bot.

Common Use Cases

1. Deployment Notifications

Trigger: Webhook (CI/CD pipeline)

Workflow:

  1. Discord: Send Message
    Channel: #deployments
    Content: ✅ Deployed {{release.tag}} to production by {{deploy.author}}
  2. Discord: Send Message (on failure)
    Channel: #alerts
    Content: ❌ Deployment failed for {{release.tag}} — check CI logs

2. New Customer Welcome

Trigger: Stripe trigger / form submission

Workflow:

  1. Discord: Add Role
    User ID: {{customer.discordId}}
    Role ID: {{roles.customerId}}
  2. Discord: Send Message
    Channel: #new-customers
    Content: Welcome {{customer.name}} to the community!

3. Support Ticket Alerts

Trigger: Freshdesk / Zendesk webhook

Workflow:

  1. Condition: {{ticket.priority}} = "urgent"
  2. Discord: Send Webhook (to #urgent-support)
    Content: 🚨 Urgent ticket: {{ticket.subject}} — from {{ticket.customerEmail}}

4. Community Event Channels

Trigger: Schedule Trigger or form submission

Workflow:

  1. Discord: Create Channel
    Name: event-{{event.name}}
    Topic: Discussion for {{event.date}} event
  2. Discord: Send Message (announcement in #events)
    Content: New channel created for #event-{{event.name}}!
  3. After event: Discord: Delete Channel

5. Role-Based Access Control

Trigger: Webhook (payment completed, course finished, etc.)

Workflow:

  1. Condition: {{payment.status}} = "succeeded"
  2. Discord: Add Role (premium role)
  3. Discord: Send Message (welcome to premium)

OR on subscription cancelled:

  1. Discord: Remove Role (premium role)
  2. Discord: Send Message (subscription ended)

Best Practices

  • Use webhooks for simple one-way notifications — no bot setup required
  • Use the bot when you need to manage roles, read messages, or manage channels
  • ✅ Grant only the minimum permissions your workflows actually need
  • ✅ Use Channel IDs (not names) — they never change even if the channel is renamed
  • ✅ Store Server ID and Channel IDs as workflow variables for reuse
  • ✅ Always test in a dedicated test channel before rolling out to production channels

Troubleshooting

"Missing Permissions" (403)

Fix:

  • Check that your bot has the required permission for the action
  • Verify the bot's role is above the target role in the server hierarchy (for Add/Remove Role)
  • Ensure the bot has been invited with the correct permission scopes

"Unknown Channel" (404)

Fix:

  • Verify the Channel ID is correct (right-click channel → Copy Channel ID)
  • Ensure the bot is a member of the server that contains the channel

"Missing Access" (403 on messages)

Fix:

  • The bot must have View Channel + Send Messages permissions for the target channel
  • Check channel-specific permission overrides in Discord settings

Bot not appearing in server

Fix: Re-invite the bot using the OAuth2 URL Generator with the correct permissions.

Limitations

  • Rate Limits: Discord allows approximately 50 requests per second globally; channel-specific limits apply to messages
  • Message Length: Maximum 2,000 characters per message
  • Bulk operations: Bulk message deletion (>14 days old) requires the MANAGE_MESSAGES permission and uses a separate endpoint not covered in this block — use an HTTP Request block for that
  • DMs: Direct messaging users is not supported in the current version

Related Blocks

  • Webhook Trigger: Receive Discord interactions in your workflow (requires a separate bot endpoint setup)
  • Condition: Route logic based on Discord event data
  • Slack: Alternative team notification channel
  • Send Email: For notifications outside Discord
  • Schedule Trigger: Post scheduled digests or reports to Discord

Need Help?

Pro Tip: For simple channel notifications (CI alerts, monitoring, reports), use the Send Webhook action — it requires no bot credentials, just a webhook URL that anyone with channel management permissions can create in Discord settings.

Indite Documentation v1.6.0
PrivacyTermsSupport