Create a Discord web trigger
You can create a web trigger to connect Unity Version Control with Discord to receive notifications. The notification includes the information available to the specific trigger that you use.
Create a Discord Webhook
First, you need to choose which channel you want to receive notifications:
- Right-click on the channel and select Edit channel > Integrations.
- Select Create Webhook.
- Select the webhook that appears to expand it. You can change the name and channel if you need to.
- Select Copy Webhook URL.
Create the UVCS Webtrigger
You can then use the Discord Webhook URL to set up a webtrigger. For a complete list of the types of triggers you can use, refer to this list of triggers.
You need to use the webtrigger-discord
string (instead of webtrigger
) before the script path, followed by the Discord webhook:
webtrigger-discord https://discordapp.com/api/webhooks/${channelId}/${token}
Example Discord web triggers
This example uses an after-ci
so that you get a notification when someone runs a check in operation:
> cm trigger make after-ci NotifyTeam-Ci "webtrigger-discord https://discord.com/api/webhooks/810908382236114944/1ibzJPH4lm13dx9-95f5dY5UP8KsgQRw4yXKu71Gj0oIflEmosidoO9714enganado01ULCvA" --server=localhost:8787
The following example uses an after-mkbranch
trigger so that you get a notification when anyone creates a new branch:
> cm trigger make after-mkbranch NotifyTeam-Branch "webtrigger-discord https://discord.com/api/webhooks/810908382236114944/1ibzJPH4lm13dx9-95f5dY5UP8KsgQRw4yXKu71Gj0oIflEmosidoO9714enganado01ULCvA" --server=localhost:8787