> ## Documentation Index
> Fetch the complete documentation index at: https://docs.devhelm.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Discord

> Send DevHelm incident alerts to Discord channels using webhooks

Connect DevHelm to Discord to receive incident notifications in your server channels.

## Setup

<Steps>
  <Step title="Create a Discord webhook">
    1. In Discord, right-click a channel → **Edit Channel** → **Integrations** → **Webhooks**
    2. Click **New Webhook** and name it (e.g., "DevHelm Alerts")
    3. Copy the webhook URL
  </Step>

  <Step title="Create the alert channel in DevHelm">
    <CodeGroup>
      ```bash CLI theme={null}
      devhelm alert-channels create \
        --name "Discord Alerts" \
        --type discord \
        --webhook-url "https://discord.com/api/webhooks/..."
      ```

      ```yaml devhelm.yml theme={null}
      alertChannels:
        - name: Discord Alerts
          config:
            channelType: discord
            webhookUrl: ${DISCORD_WEBHOOK_URL}
            mentionRoleId: "123456789"
      ```
    </CodeGroup>
  </Step>

  <Step title="Test the channel">
    ```bash theme={null}
    devhelm alert-channels test <channel-id>
    ```
  </Step>
</Steps>

## Configuration

| Field           | Description                                 | Required |
| --------------- | ------------------------------------------- | -------- |
| `webhookUrl`    | Discord webhook URL                         | Yes      |
| `mentionRoleId` | Discord role ID to mention in notifications | No       |

### Finding a role ID

To mention a role in notifications, you need the role ID:

1. Enable **Developer Mode** in Discord (User Settings → Advanced)
2. Right-click the role in Server Settings → Roles → **Copy Role ID**

## Troubleshooting

<AccordionGroup>
  <Accordion title="Webhook URL rejected">
    The URL must start with `https://discord.com/api/webhooks/` or `https://discordapp.com/api/webhooks/`.
  </Accordion>

  <Accordion title="Messages not appearing">
    1. Verify the webhook hasn't been deleted in Discord channel settings
    2. Check that the bot has permission to post in the channel
    3. Run `devhelm alert-channels test <id>`
  </Accordion>
</AccordionGroup>
