fix(notifications): send error and reject events (#217)

* fix: send notifications with correct events

* feat: set err color red
This commit is contained in:
Ludvig Lundgren 2022-04-05 19:18:00 +02:00 committed by GitHub
parent 431742fd94
commit 2f358473f3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 38 additions and 12 deletions

View file

@ -40,13 +40,19 @@ func discordNotification(event domain.EventsReleasePushed, webhookURL string) {
client := http.Client{Transport: t, Timeout: 15 * time.Second}
color := map[domain.ReleasePushStatus]int{
domain.ReleasePushStatusApproved: 5814783,
domain.ReleasePushStatusRejected: 5814783,
domain.ReleasePushStatusErr: 14026000,
}
m := DiscordMessage{
Content: nil,
Embeds: []DiscordEmbeds{
{
Title: event.ReleaseName,
Description: "New release!",
Color: 5814783,
Color: color[event.Status],
Fields: []DiscordEmbedsFields{
{
Name: "Status",