Skip to content

Commit

Permalink
fix: omit avatar_url in discord payload when empty (go-gitea#22393)
Browse files Browse the repository at this point in the history
Fixes go-gitea#22391

This field is optional for Discord, however when it exists in the
payload it is now validated.
Omitting it entirely just makes Discord use the default for that
webhook, which is set on the Discord side.

Signed-off-by: jolheiser <john.olheiser@gmail.com>
  • Loading branch information
jolheiser committed Jan 10, 2023
1 parent 03f06d5 commit 27ef58c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion services/webhook/discord.go
Expand Up @@ -54,7 +54,7 @@ type (
Wait bool `json:"wait"`
Content string `json:"content"`
Username string `json:"username"`
AvatarURL string `json:"avatar_url"`
AvatarURL string `json:"avatar_url,omitempty"`
TTS bool `json:"tts"`
Embeds []DiscordEmbed `json:"embeds"`
}
Expand Down

0 comments on commit 27ef58c

Please sign in to comment.