Skip to content
Merged
Changes from 3 commits
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
4 changes: 3 additions & 1 deletion 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 discordDescriptionCharactersLimit = 2000

type discordConvertor struct {
Username string
AvatarURL string
Expand Down Expand Up @@ -313,7 +315,7 @@ func (d discordConvertor) createPayload(s *api.User, title, text, url string, co
Embeds: []DiscordEmbed{
{
Title: title,
Description: text,
Description: util.TruncateRunes(text, discordDescriptionCharactersLimit), // Discord has some limits in place for the embeds, to keep it simple we currently truncate at 2000
URL: url,
Color: color,
Author: DiscordEmbedAuthor{
Expand Down
Loading