Discord error 50005: Cannot edit a message authored by another user
Last verified against Discord Developer Docs - Opcodes and status codes
Cannot edit a message authored by another userWhat error 50005 means
Message content can only be edited by the account that sent it. No permission, not even Administrator, allows a bot to change the text or embeds of someone else's message. If your bot PATCHes /channels/{id}/messages/{id} on a message it did not author, the result is 50005.
There are two narrow exceptions that trip people up. Messages sent through a webhook can be edited by anyone holding the webhook's token via PATCH /webhooks/{id}/{token}/messages/{message.id}, because the webhook is the author. And Manage Messages lets you change a small set of flags on others' messages (for example suppressing embeds via the flags field), but not content. Trying to edit content with that permission still returns 50005.
Bots that relay or "proxy" messages (send a webhook copy of a user's text) must remember which webhook sent each copy; editing via the bot token rather than the webhook token fails.
What it looks like
{
"message": "Cannot edit a message authored by another user",
"code": 50005
}Why it happens
- Bot edits a message sent by a user, another bot, or a different webhook
- Bot edits a webhook-sent message through the channel messages endpoint instead of the webhook endpoint
- Two bots sharing a feature; bot A tries to edit bot B's message
- After a token rotation, the bot user is the same, so this is not the cause; check author.id
How to fix Discord error 50005
- 1Compare message.author.id with your bot's user ID before attempting an edit
- 2For webhook-sent messages, edit via PATCH /webhooks/{webhook.id}/{webhook.token}/messages/{message.id}
- 3If you need to change others' messages, delete and re-send (with Manage Messages) or quote them instead
- 4To suppress embeds on another user's message, PATCH only flags: 4 (SUPPRESS_EMBEDS) with Manage Messages
How to stop it recurring
Store the author identity (bot user or webhook ID and token) alongside every message ID your bot may later edit, and choose the edit route from that record. Never assume a message in a bot-managed channel was sent by the bot.
Relay and proxy bots should record, at send time, exactly which identity authored each copy; retrofitting that after users ask for edit support is painful. Webhook-authored messages follow the webhook editing routes described in the webhook debugging guide, and messages that have since vanished fail with 10008 before authorship is even checked.
Official reference: Discord Developer Docs - Opcodes and status codes. See all Discord error codes or the Discord limits and quotas.
Related codes
Error 50005 - quick answers
What does Discord error 50005 mean?
Message content can only be edited by the account that sent it. No permission, not even Administrator, allows a bot to change the text or embeds of someone else's message. If your bot PATCHes /channels/{id}/messages/{id} on a message it did not author, the result is 50005. There are two narrow exceptions that trip people up.
How do I fix Discord error 50005?
1. Compare message.author.id with your bot's user ID before attempting an edit 2. For webhook-sent messages, edit via PATCH /webhooks/{webhook.id}/{webhook.token}/messages/{message.id} 3. If you need to change others' messages, delete and re-send (with Manage Messages) or quote them instead 4. To suppress embeds on another user's message, PATCH only flags: 4 (SUPPRESS_EMBEDS) with Manage Messages
Should I retry after error 50005?
No. Retrying the same request produces the same error; the condition has to be fixed first. Treat it as a permanent failure for that message and surface it, rather than looping.
Stop debugging Discord by hand
Connect the channel through Conferbot: tokens, webhooks and retries are handled, failures show as readable status.