Skip to content

Commit 27ef58c

Browse files
committed
fix: omit avatar_url in discord payload when empty (go-gitea#22393)
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 <[email protected]>
1 parent 03f06d5 commit 27ef58c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

services/webhook/discord.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ type (
5454
Wait bool `json:"wait"`
5555
Content string `json:"content"`
5656
Username string `json:"username"`
57-
AvatarURL string `json:"avatar_url"`
57+
AvatarURL string `json:"avatar_url,omitempty"`
5858
TTS bool `json:"tts"`
5959
Embeds []DiscordEmbed `json:"embeds"`
6060
}

0 commit comments

Comments
 (0)