mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 16:59:12 +00:00
fix(notifications): send error and reject events (#217)
* fix: send notifications with correct events * feat: set err color red
This commit is contained in:
parent
431742fd94
commit
2f358473f3
2 changed files with 38 additions and 12 deletions
|
@ -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",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue