Discord
Overview
Send notifications to a Discord channel.
About Discord Notifier
The discord notifier allows to get notified on your favorite discord channel when an instance of semaphore is detecting changes in the configuration of your flags.
Each notification lists the flags that were created, updated or deleted. For an updated flag, every change is described as a short sentence, for example:
✏️ Flag "dark-mode" updated
• Version set to `2`
• Targeting rule `beta-users` now matches `beta eq true or company eq "acme"` (was `beta eq true`)
• Targeting rule `internal` added: serves `enabled` when `email ew "@example.com"`
• Default rule now serves `disabled` 50%, `enabled` 50% (was `disabled` 90%, `enabled` 10%)A flag shows at most 50 changes, and a last line counts the changes left out. Discord limits the size of a message, so when many flags change at once the longest lists are shortened first. If more than 10 flags change, the message shows the first 9 and asks you to check the logs for the rest.
Configure Discord Notifications
Connect to your discord account and go on the channel where you want to send the notifications.
Go on the settings menu of your channel.
Under your channel’s settings, go to the "Integrations" section and create a new webhook. To create it, please follow the official documentation.
Copy the webhook URL
Now you can configure your notifier
Configure the relay proxy
To configure your relay proxy to use the Discord notifier, you need to add the following configuration to your relay proxy configuration file:
# ...
notifier:
- kind: discord
webhookUrl: "https://discord.com/api/webhooks/yyyy/xxxxxxx"
# ...| Field name | Mandatory | Type | Default | Description |
|---|---|---|---|---|
kind | Yes | string | none | Value should be discord.This field is mandatory and describe which retriever you are using. |
webhookUrl | Yes | string | none | The complete URL of your incoming webhook configured in Discord. |
Configure the GO Module
To configure your GO module to use the Discord notifier, you need to add the following configuration to your ffclient.Config{} object:
client, err := ffclient.New(ffclient.Config
{
// ...
Notifiers: []notifier.Notifier{
&discordnotifier.Notifier{
DiscordWebhookURL: "https://discord.com/api/webhooks/yyyy/xxxxxxx",
},
},
})
defer client.Close()| Field | Mandatory | Description |
|---|---|---|
DiscordWebhookURL | Yes | The complete URL of your discord webhook. |