From 09d1f359d56c7e30574cf9a5c011b533010b7b64 Mon Sep 17 00:00:00 2001 From: ulnanlu <220980518+ulnanlu@users.noreply.github.com> Date: Fri, 5 Sep 2025 20:19:31 +0200 Subject: [PATCH] fix(webhook/discord): fixed username cannot be empty error (#35412) username field is not required by discord and used to override the default username. sending it as blank causes a 400 error. it should be omitted instead when it's not set. Ref: https://discord.com/developers/docs/resources/webhook#execute-webhook-jsonform-params Closes #35411 --- services/webhook/discord.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/services/webhook/discord.go b/services/webhook/discord.go index 0426964181..6f045bd112 100644 --- a/services/webhook/discord.go +++ b/services/webhook/discord.go @@ -57,7 +57,7 @@ type ( DiscordPayload struct { Wait bool `json:"wait"` Content string `json:"content"` - Username string `json:"username"` + Username string `json:"username,omitempty"` AvatarURL string `json:"avatar_url,omitempty"` TTS bool `json:"tts"` Embeds []DiscordEmbed `json:"embeds"`