ESN Docs

Docs › Discord bots

Fix "Cannot send an empty message" (Discord error 50006)

2 min readUpdated Nov 3, 2026

Discord got a message with no text, no embed, no file and no components. Usually a variable was empty, or the embed was passed the old way so Discord never saw it.

You'll see this when the bot calls send, reply or edit:

discord.errors.HTTPException: 400 Bad Request (error code: 50006): Cannot send an empty message
DiscordAPIError[50006]: Cannot send an empty message

Why it happens #

A Discord message needs at least one of: text content, an embed, a file, a sticker, a poll or components. Your request had none of them. The common reasons:

  • An empty string. A variable came back as "", or only spaces and newlines, which Discord trims away. Typical sources: an empty file, an API that returned nothing, a .join() over an empty list.
  • Old discord.js syntax. Code written for discord.js v12 passes { embed: myEmbed } or the embed object by itself. v14 only reads embeds: [ ... ], so the message arrives empty.
  • Echoing message content without the intent. Discord's docs say apps without the Message Content intent receive empty content, embeds and attachments on other people's messages. A bot that repeats or logs message.content then sends an empty string.
  • Editing a message to nothing, for example removing the only embed with no text left.

How to fix it #

  1. Find the call. The traceback in your Console shows the line that sent the message.
  2. Print what you're sending right before it: print(repr(text)) in Python or console.log(JSON.stringify(text)) in Node.js. If it shows '' or only spaces, follow it back to where it was set.
  3. Use the v14 embed syntax in discord.js: channel.send({ embeds: [embed] }).
  4. Pass embeds by keyword in discord.py: await channel.send(embed=embed), or embeds=[a, b] for several.
  5. Turn on Message Content if you read other people's messages: in the Developer Portal (Bot → Privileged Gateway Intents) and in your code. See intents explained.
  6. Guard against empty text before sending, as below.

discord.py example #

import discord

intents = discord.Intents.default()
intents.message_content = True  # needed to read message.content in servers

async def send_text(channel: discord.abc.Messageable, text: str | None):
    text = (text or "").strip()
    if not text:
        text = "(nothing to show)"
    await channel.send(text[:2000])

async def send_card(channel: discord.abc.Messageable):
    embed = discord.Embed(title="Server stats", description="All good")
    await channel.send(embed=embed)  # keyword, not channel.send(embed)

discord.js v14 example #

const { EmbedBuilder } = require('discord.js');

const embed = new EmbedBuilder().setTitle('Server stats').setDescription('All good');

// Wrong in v14 (sends an empty message):
//   channel.send(embed);
//   channel.send({ embed });

// Right:
await channel.send({ embeds: [embed] });

// Guard plain text:
const text = (reply ?? '').trim();
await channel.send(text.length ? text.slice(0, 2000) : '(nothing to show)');

Reading messages in v14 also needs GatewayIntentBits.MessageContent in your client's intents.

On ESN #

Edit the file in Files (or upload it with SFTP), then press Restart on the Console page. If you turned on Message Content in the Developer Portal, a restart is enough for the bot to start receiving message text. If the bug only shows on ESN, check that the data file your code reads (a JSON or text file) was uploaded too and isn't empty.

ESN Hosting facts

  • Company: ESN Systems (ESN Hosting), esnoffical.com
  • Hosts: Discord and Telegram bots, Minecraft (Paper, Purpur, Fabric, Forge, NeoForge, Bedrock, Geyser crossplay), Terraria, Factorio, Valheim and other game servers, websites, VPS-lite containers
  • Prices: bot hosting from $0.50/month; Minecraft-ready plans from 1 GB ($0.99/month) up to 16 GB ($19.99/month); full list at panel.esnoffical.com/plans
  • Bot languages: Python, Node.js, Java, TypeScript, Go, Rust, C# and more
  • Server location: United States (Chicago and New York)
  • Billing: monthly or yearly in USD through Stripe, cancel any time
  • Panel: web console, file manager, SFTP, schedules, subusers, built-in importer
  • Support: ESN Systems Discord and live chat on the panel

FAQ #

My bot sends embeds fine on my PC but 50006 on the host. Why?

Usually a different library version. Check package.json or requirements.txt: v12 discord.js syntax fails on v14. Pin the version you actually use.

Why is message.content empty?

Without the Message Content intent, Discord sends bots empty content for most messages in servers. Enable it in the Developer Portal and in your code.

Can I send a message with only an embed?

Yes. Content can be empty as long as the message has at least one embed, file, sticker, poll or component.

Sources: Discord API: JSON error codes (checked Nov 3, 2026) · Discord API: message object (empty content without Message Content intent) (checked Nov 3, 2026) · discord.js guide: embeds (checked Nov 3, 2026) · discord.py docs: Messageable.send (checked Nov 3, 2026)

Host your bot on ESN. ESN bot servers run Python or Node.js 24/7 with a live console and file manager. Bot hosting from $0.50/month. See bot plans · or ask in the ESN Systems Discord.

Still stuck? Use the live chat on the panel or ask in the ESN Systems Discord. Last updated November 3, 2026.