Discord
Integrate Discord with Enbbox for chat notifications. Send notifications to Discord channels and users via bot tokens and webhook URLs.
Overview
Discord is a community platform. Enbbox sends notifications to Discord channels using Webhooks.
Step 1: Create a Discord Webhook
- Open Discord and navigate to the server/channel where you want notifications
- Click the gear icon next to the channel name → Integrations
- Click Webhooks → New Webhook
- Give the webhook a name (e.g., "Enbbox Notifications")
- Optionally set an avatar
- Click Copy Webhook URL
The URL looks like: https://discord.com/api/webhooks/1234567890/abcdefg...
Step 2: Connect to Enbbox
- Navigate to Integrations in the Enbbox dashboard
- Click Add Provider → select Chat → Discord
- No global credentials are needed — Discord uses per-subscriber webhook URLs
- Activate the integration
Step 3: Configure Subscriber Credentials
import { SubscriberCredentialsApi, Configuration } from "@enbbox/api";
const config = new Configuration({ accessToken: "your-api-key" });
const credentialsApi = new SubscriberCredentialsApi(config);
await credentialsApi.setCredentials("subscriber-123", "discord", {
credentials: { webhook_url: "https://discord.com/api/webhooks/1234567890/abcdefg..." },
});Step 4: Send a Test Notification
import { EventsApi, Configuration } from "@enbbox/api";
const config = new Configuration({ accessToken: "your-api-key" });
const eventsApi = new EventsApi(config);
await eventsApi.triggerEvent({
name: "server-alert",
to: { subscriberId: "subscriber-123" },
payload: { message: "⚠️ Server CPU usage exceeded 90%" },
});Advanced: Discord Bot
For richer features (embeds, reactions, DMs), create a Discord Bot:
- Go to discord.com/developers/applications
- Click New Application → name it → Create
- Navigate to Bot → Add Bot
- Copy the Bot Token
- Under OAuth2 → URL Generator, select
botscope andSend Messagespermission - Use the generated URL to invite the bot to your server
Troubleshooting
| Issue | Solution |
|---|---|
| Webhook URL invalid | Regenerate the webhook in channel settings |
| Message not delivered | Ensure the webhook hasn't been deleted |
| Embed not rendering | Check that your message format follows Discord's embed structure |