Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions services/webhook/discord.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ var (
redColor = color("ff3232")
)

const discordDescriptionBytesLimit = 2048

type discordConvertor struct {
Username string
AvatarURL string
Expand Down Expand Up @@ -307,6 +309,9 @@ func parseHookPullRequestEventType(event webhook_module.HookEventType) (string,
}

func (d discordConvertor) createPayload(s *api.User, title, text, url string, color int) DiscordPayload {
if len(text) > discordDescriptionBytesLimit {
text = text[:discordDescriptionBytesLimit]
}
return DiscordPayload{
Username: d.Username,
AvatarURL: d.AvatarURL,
Expand Down