From f365f3796e57c37f5389d7c46bb69cb3f221cebc Mon Sep 17 00:00:00 2001 From: Christopher Banck Date: Tue, 8 Feb 2022 10:52:21 +0100 Subject: [PATCH 1/2] update discord properties * username optional * channel optional and remove it from payload Signed-off-by: Christopher Banck --- internal/notifier/discord.go | 9 --------- 1 file changed, 9 deletions(-) diff --git a/internal/notifier/discord.go b/internal/notifier/discord.go index c0378424f..ad5db25d4 100644 --- a/internal/notifier/discord.go +++ b/internal/notifier/discord.go @@ -48,14 +48,6 @@ func NewDiscord(hookURL string, proxyURL string, username string, channel string hookURL = webhook.String() } - if username == "" { - return nil, errors.New("empty Discord username") - } - - if channel == "" { - return nil, errors.New("empty Discord channel") - } - return &Discord{ Channel: channel, URL: hookURL, @@ -72,7 +64,6 @@ func (s *Discord) Post(event events.Event) error { } payload := SlackPayload{ - Channel: s.Channel, Username: s.Username, } if payload.Username == "" { From 67c58d6ccbe0eb608cbbe995cb363ed509beb859 Mon Sep 17 00:00:00 2001 From: Christopher Banck Date: Tue, 8 Feb 2022 11:53:49 +0100 Subject: [PATCH 2/2] remove unused errors import Signed-off-by: Christopher Banck --- internal/notifier/discord.go | 1 - 1 file changed, 1 deletion(-) diff --git a/internal/notifier/discord.go b/internal/notifier/discord.go index ad5db25d4..1e0bd9f05 100644 --- a/internal/notifier/discord.go +++ b/internal/notifier/discord.go @@ -17,7 +17,6 @@ limitations under the License. package notifier import ( - "errors" "fmt" "net/url" "path"