---
title: Discord
description: Configure Discord as a chat provider in Notiflows
---

Discord integration enables notifications to be sent to Discord channels and servers via the Discord Bot API.

## Configuration

To create a chat channel with Discord, configure the following:

| Field | Required | Description |
|-------|----------|-------------|
| Bot Token | Yes | Discord bot token from the Developer Portal |

## Prerequisites

Before configuring Discord in Notiflows:

1. A Discord server where you have admin permissions
2. A Discord application created at the [Developer Portal](https://discord.com/developers/applications)

## Creating a Discord Bot

1. Go to [discord.com/developers/applications](https://discord.com/developers/applications)
2. Click **New Application** and give it a name
3. Navigate to **Bot** in the left sidebar
4. Click **Reset Token** to generate a new bot token — copy it immediately
5. Under **Privileged Gateway Intents**, enable **Message Content Intent** if you need to read messages
6. Navigate to **OAuth2** > **URL Generator**
7. Select the `bot` scope and the following permissions:
   - `Send Messages`
   - `Embed Links`
   - `Attach Files` (optional, for rich media)
8. Copy the generated URL and open it to invite the bot to your server

## Setup in Notiflows

1. Navigate to **Channels** in your project
2. Click **Create Channel**
3. Select **Chat** as the channel type
4. Select **Discord** as the provider
5. Paste your Bot Token
6. Save the channel

## User Channel Settings

To send Discord notifications to a user, set their target channel via the Admin API:

```bash
curl -X PUT /api/admin/v1/users/:user_external_id/channel-settings/:channel_id \
  -d '{ "settings": { "discord_channel_id": "1234567890123456789" } }'
```

| Field | Description |
|-------|-------------|
| `discord_channel_id` | Discord channel ID where messages will be sent |

To find a channel ID, enable **Developer Mode** in Discord settings, then right-click a channel and select **Copy Channel ID**.

## Templates

Chat templates support two content types:
- **Markdown** — Discord-flavored markdown formatting
- **JSON** — Discord embed format for rich messages

Use Liquid templating for dynamic content:

```liquid
New deployment by {{ actor.first_name }}: **{{ data.service }}** → `{{ data.version }}`
```

For rich embeds, use JSON content type:

```json
{
  "title": "Deployment Complete",
  "description": "{{ data.service }} deployed to {{ data.environment }}",
  "color": 3066993
}
```

Available variable contexts:
- `recipient.*` — Recipient user data
- `actor.*` — User who triggered the notification
- `data.*` — Custom payload passed when triggering the notiflow
