Skip to content
GitHub

DiscordLimits

variable in meocord/common Since 4.3.0

const DiscordLimits: Readonly<{
  readonly content: 2000
  readonly embeds: 10
  readonly embedTitle: 256
  readonly embedDescription: 4096
  readonly embedFields: 25
  readonly embedFieldName: 256
  readonly embedFieldValue: 1024
  readonly embedFooterText: 2048
  readonly embedAuthorName: 256
  readonly embedTotal: 6000
  readonly customId: 100
  readonly buttonLabel: 80
  readonly selectOption: 100
  readonly textInputValue: 4000
  readonly textDisplay: 4000
}>

Discord's length and count limits for what a bot sends, in characters as string.length counts them.

Over a limit, Discord refuses the whole message. splitMessage and truncate fit text to these; route().build() and @Command check customIds against customId. Each value is from Discord's message resource and component reference, except textDisplay, which Discord's reference leaves open and @discordjs/builders enforces.

Examples

TypeScript
declare const summary: string

const embed = new EmbedBuilder().setDescription(truncate(summary, DiscordLimits.embedDescription))

See also

  • Formatting