Skip to content
DiscordTwitter

Discord Webhook Setup

This guide walks you through creating a Discord webhook and obtaining the URL needed to use Discord components in GrailHub.

  • A Discord account
  • Access to a Discord server where you have Manage Webhooks permission
  • Discord app installed (desktop or web)
  1. Open Discord and navigate to the server where you want to receive notifications
  2. Click on the server name at the top-left to open the dropdown menu
  3. Select Server Settings
  1. In the left sidebar, click on Integrations
  2. Click on Webhooks
  3. Click New Webhook or Create Webhook
  1. Name: Give your webhook a descriptive name (e.g., “GrailHub Alerts”)
    • This name will appear as the sender of messages
  2. Channel: Select the channel where messages should be sent
  3. Avatar (optional): Upload a custom avatar image for the webhook
  1. Click Copy Webhook URL
  2. The URL looks like this:
    https://discord.com/api/webhooks/1234567890/abcdefghijklmnopqrstuvwxyz

Click Save Changes to finalize your webhook configuration.

The Notification component sends messages to Discord:

ConfigDescription
Webhook URLYour Discord webhook URL
Bot UsernameOptional custom name for the message sender
Avatar URLOptional custom avatar URL
Message TemplateThe message content (supports templates)
  1. Add a Notification component to your flow
  2. Configure the component:
    • Webhook URL: https://discord.com/api/webhooks/...
    • Bot Username: Trading Bot (optional)
    • Message Template: 🚨 Price Alert: {{.Symbol}} is now ${{.Price}}

Discord supports various formatting options in webhook messages:

FormatSyntaxExample
Bold**text**bold
Italic*text*italic
Strikethrough~~text~~strikethrough
Code`code`code
Code Block```code```Multi-line code

Simple Alert:

🚨 **Price Alert**
Symbol: {{.Symbol}}
Price: ${{.Price}}

Detailed Notification:

📊 **Trading Signal**
━━━━━━━━━━━━━━━━━━
**Symbol:** {{.Symbol}}
**Action:** {{.Action}}
**Price:** ${{.Price}}
**Time:** {{.Timestamp}}
  1. Go to Server SettingsIntegrationsWebhooks
  2. Click on the webhook you want to edit
  3. Make your changes and click Save Changes
  1. Go to Server SettingsIntegrationsWebhooks
  2. Click on the webhook you want to delete
  3. Click Delete Webhook and confirm

If your webhook URL is compromised:

  1. Go to Server SettingsIntegrationsWebhooks
  2. Click on the webhook
  3. Delete the webhook and create a new one
  4. Update the URL in your GrailHub flows

Ensure the channel where you’re sending webhooks has appropriate permissions:

  • View Channel: Webhook needs to see the channel
  • Send Messages: Webhook needs to send messages

Webhooks work in private channels as long as:

  1. The webhook was created for that specific channel
  2. The channel still exists

Discord has rate limits for webhooks:

  • 5 requests per 2 seconds per webhook
  • 30 requests per minute per channel

If you exceed these limits, Discord will temporarily block requests. GrailHub handles rate limiting gracefully, but consider:

  • Using separate webhooks for different alert types
  • Batching notifications when possible
  • Avoiding high-frequency alerts
  • Verify the webhook URL is correct and complete
  • Check that the target channel still exists
  • Ensure the webhook hasn’t been deleted
  • Verify you have the correct permissions
  • The URL must start with https://discord.com/api/webhooks/
  • Ensure no extra spaces or characters in the URL
  • Try creating a new webhook if the issue persists
  • Wait a few seconds before sending more messages
  • Consider reducing notification frequency
  • Use multiple webhooks for high-volume alerts
  • Webhooks are tied to specific channels
  • To change channels, edit the webhook in Server Settings
  • Or create a new webhook for the desired channel
  1. Never share webhook URLs - Treat them like passwords
  2. Use private channels - For sensitive trading alerts
  3. Rotate URLs periodically - Delete and recreate webhooks
  4. Limit server access - Only trusted members should manage webhooks
  5. Monitor webhook usage - Check for unexpected messages

For complex setups, consider using multiple webhooks:

WebhookChannelPurpose
Price Alerts#alertsPrice threshold notifications
Trade Signals#signalsBuy/sell signals
System Status#statusFlow status updates

This allows:

  • Better organization of notifications
  • Different notification frequencies
  • Separate rate limit pools