Discord
Create a Discord channel webhook and a HotCodePush webhook in Discord format, and every subscribed release event posts to the channel without pinging anyone.
HotCodePush posts a message to a Discord channel for every event you subscribe to. A webhook on the Discord channel gives you the URL, and a HotCodePush webhook in the discord format posts to it.
Prerequisites
- You have an organization whose plan includes webhooks. Billing and MAU lists what each plan includes.
- You hold the Admin or Owner role in that organization.
- You hold the Manage Webhooks permission on the Discord server.
Create the webhook in Discord
If the channel already has a webhook you can reuse, skip to step 4.
- Open the server's Server Settings and go to the Integrations tab.
- Click Create Webhook.
- Give the webhook a name such as
HotCodePushand pick the text channel it posts to. An avatar is optional: click the image beside the name. - Click Copy Webhook URL.
The URL is the secret
The URL ends in the webhook's token, and anyone who holds it can post to the channel. Paste it into HotCodePush and keep it out of code and chat.
Create the webhook in HotCodePush
- Open your organization in the console, then Settings › Webhooks, and choose Create webhook.
- Enter a name, choose the format Discord and paste the URL from Discord.
- Pick the events to deliver. Pick one app as the filter when the channel should follow one app only.
- Choose Create. The webhook is enabled at once.
The six release events above cover a release channel. Events and payload lists every type. Webhooks has the message format and the delivery log. Signature and retries covers the retries.
Messages post under the name and avatar you gave the webhook in Discord. Mentions are switched off, so an @everyone or @here in a release note stays plain text and pings nobody.
Send a test event
In the console, open the webhook and choose Test. From the CLI:
npx hotcodepush webhook test --webhook "Releases to Discord"If Discord answers an error, create a new webhook there and change the webhook's URL in HotCodePush. If nothing happens, see the delivery log on Webhooks.
Next steps
- Webhooks explains the message format, the
rawpayload and the delivery log. Signature and retries covers the retries. - Roll out gradually explains the staged rollout and the auto-pause rule behind the paused and failure-rate events.
- Slack and Microsoft Teams show the same setup for the other two targets.
Last updated on