Skip to content

Add embed character count to message builder and embeds.

Mateusz Brawański requested to merge github/fork/loukylor/master into master

Created by: loukylor

Summary

Adds a check so that the 6000 character limit on embeds is easier to track.

Details

Right now, there's no easy way to check if you've exceeded the 6000 character limit on message embeds. This should hopefully fix that issue.

Changes proposed

  • Adds a CharCount property to DiscordEmbed, DiscordEmbedField, DiscordEmbedFooter, DiscordEmbedAuthor, DiscordEmbedBuilder, EmbedAuthor, and EmbedFooter.
  • It also adds an EmbedsCharCount property to DiscordMessageBuilder.
  • A check to make sure the count does not exceed 6000 is in place for DiscordEmbedBuilder's and DiscordMessageBuilder's property. If the number is exceeded, an ArgumentException will throw.
  • The properties only reflect the characters that Discord counts.

Merge request reports