diff --git a/README.md b/README.md index e1bfc4d..2d8736c 100644 --- a/README.md +++ b/README.md @@ -67,7 +67,7 @@ This will display help for the tool. Here are all the switches it supports. | `-proxy` | http proxy to use with notify | `notify -proxy http://127.0.0.1:8080` | | `-rate-limit` | maximum number of HTTP requests to send per second | `notify -rl 1` | | `-silent` | enable silent mode | `notify -silent` | -| `-verbose` | enable verbose mode | `notify -version` | +| `-verbose` | enable verbose mode | `notify -verbose` | | `-version` | display version | `notify -version` | diff --git a/pkg/providers/discord/discord.go b/pkg/providers/discord/discord.go index 4decc10..a8e66c2 100644 --- a/pkg/providers/discord/discord.go +++ b/pkg/providers/discord/discord.go @@ -2,6 +2,7 @@ package discord import ( "fmt" + "net/url" "github.com/containrrr/shoutrrr" "github.com/oriser/regroup" @@ -55,7 +56,9 @@ func (p *Provider) Send(message, CliFormat string) error { } webhookID, webhookToken := matchedGroups["webhook_identifier"], matchedGroups["webhook_token"] - url := fmt.Sprintf("discord://%s@%s?splitlines=no", webhookToken, webhookID) + url := fmt.Sprintf("discord://%s@%s?splitlines=no&username=%s", webhookToken, webhookID, + url.QueryEscape(pr.DiscordWebHookUsername)) + sendErr := shoutrrr.Send(url, msg) if sendErr != nil { sendErr = errors.Wrap(sendErr, fmt.Sprintf("failed to send discord notification for id: %s ", pr.ID))