ESN Docs

Docs › Discord bots

Fix "Unknown Message" (10008) and other Unknown errors

2 min readUpdated Nov 3, 2026

Your bot asked Discord for something that no longer exists, or never existed under that ID. It's usually safe to catch and ignore, once you know why.

The errors:

discord.errors.NotFound: 404 Not Found (error code: 10008): Unknown Message
DiscordAPIError[10008]: Unknown Message

Its relatives work the same way: 10003 Unknown Channel, 10007 Unknown Member, 10011 Unknown Role and 10013 Unknown User.

Why it happens #

  • It was deleted first. A moderator, another bot or the author deleted the message before your bot edited, deleted or reacted to it.
  • Deleted twice. Your code deletes the same message in two places, for example in a command and in a timer, or with delete_after and again by hand.
  • Stale saved IDs. A reaction-role or ticket message ID saved in a database or JSON file points at a message or channel that has since been deleted.
  • Wrong channel. You fetched a message ID from a different channel than the one it lives in.
  • IDs stored as numbers in JavaScript. Discord IDs are bigger than JavaScript numbers can hold exactly. Stored as a number, an ID changes its last digits and points at nothing.
  • Unknown Member: the user left the server. Unknown Role: the role was deleted.

How to fix it #

  1. Catch the error where the bot deletes, edits or reacts. If the thing is gone, there's nothing left to do.
  2. Delete in one place only. Pick either delete_after or a manual delete.
  3. Clean up saved IDs. When a fetch fails with Not Found, remove that ID from your database so the bot stops retrying it, then set the panel or menu up again.
  4. Fetch from the right channel. Save the channel ID next to each message ID.
  5. Keep IDs as strings in Node.js, in code and in JSON files: "1234567890123456789", not 1234567890123456789.

discord.py example #

import discord

async def safe_delete(message: discord.Message):
    try:
        await message.delete()
    except discord.NotFound:
        pass  # already deleted, nothing to do

async def load_panel(bot, channel_id: int, message_id: int):
    channel = bot.get_channel(channel_id)
    if channel is None:
        return None  # channel deleted or not visible: remove it from your saved config
    try:
        return await channel.fetch_message(message_id)
    except discord.NotFound:
        return None  # message deleted: post a new panel and save the new ID

discord.NotFound covers 10008, 10003, 10007 and the other 404s, so one except is enough. Check err.code if you need to tell them apart.

discord.js v14 example #

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

async function safeDelete(message) {
  try {
    await message.delete();
  } catch (err) {
    if (err.code !== RESTJSONErrorCodes.UnknownMessage) throw err;
  }
}

// IDs stay strings, also in your JSON config:
const config = { panelChannelId: '1234567890123456789', panelMessageId: '1234567890123456790' };
const channel = await client.channels.fetch(config.panelChannelId).catch(() => null);
const panel = channel ? await channel.messages.fetch(config.panelMessageId).catch(() => null) : null;

On ESN #

Saved IDs usually live in a file in your server, such as config.json, data.json or a SQLite database. You can open JSON files in Files and fix or remove the stale ID, then press Restart. If you moved your bot from another host, check that you uploaded the latest data file; an old copy points at panels that were replaced.

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 #

Is Unknown Message dangerous to ignore?

When you were deleting or editing it, no: the message is already gone. If it happens on a message your bot needs, like a role menu, post a new one and save its ID.

Why does it say Unknown Interaction instead?

That one (10062) is about responding too late to a slash command or button. See the This interaction failed guide.

Why do my IDs work in Python but not in JavaScript?

Python integers are exact at any size. JavaScript numbers are not, so Discord IDs must be kept as strings.

Sources: Discord API: JSON error codes (checked Nov 3, 2026) · discord.py docs: HTTP exceptions (Forbidden, NotFound) (checked Nov 3, 2026) · Discord API: snowflake IDs (checked Nov 3, 2026) · discord.js guide: common errors (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.