Discord · 50035

Discord error 50035: Invalid Form Body

Discord rejected what your bot sent because part of it breaks a rule. The good news: the error tells you exactly which part, if you read past the first line.

← All errors

What you are seeing

discord.js

DiscordAPIError[50035]: Invalid Form Body embeds[0].fields[2].value[BASE_TYPE_REQUIRED]: This field is required

discord.py

discord.errors.HTTPException: 400 Bad Request (error code: 50035): Invalid Form Body

Read the path

After "Invalid Form Body" comes a path and a reason, like embeds[0].fields[2].value[BASE_TYPE_REQUIRED]. Read it left to right: the first embed, its third field (counting from zero), the value of that field, which is required. Most 50035 errors are solved by reading that line and looking at that one value.

The reasons you will meet most often are BASE_TYPE_REQUIRED (the value is empty, null or undefined), BASE_TYPE_MAX_LENGTH (it is too long) and STRING_TYPE_REGEX (it has characters the field does not allow, such as capitals in a command name).

The limits worth knowing

Message text: 2,000 characters. Embed title: 256. Embed description: 4,096. Field name: 256. Field value: 1,024, and it cannot be empty. At most 25 fields, 10 embeds per message, and 6,000 characters across all the embeds in one message.

Slash commands: names are 1 to 32 characters, lowercase, with no spaces; descriptions are 1 to 100 characters; at most 25 options and 25 choices per option.

Empty field values are the classic cause: a field built from a variable that turned out to be an empty string or undefined. Fall back to something visible.

discord.js

embed.addFields({
    name: 'Reason',
    // An empty string here is a 50035; so is anything over 1,024 characters.
    value: (reason || 'No reason given').slice(0, 1024),
});

FAQ

Questions

The error says the value is not a snowflake.

An ID was sent as a JavaScript number. Discord IDs are larger than numbers can hold exactly, so the last digits change. Keep IDs as strings everywhere, including in JSON files and databases.

discord.py only says "Invalid Form Body".

The detail is in the exception's text further down, or in its .text attribute. Print the whole exception rather than just its first line.