Discord error 50007: Cannot send messages to this user
Last verified against Discord Developer Docs - Opcodes and status codes
Cannot send messages to this userWhat error 50007 means
The bot opened (or already had) a DM channel with the user, but the user cannot receive DMs from your bot. The most common reason is the user's privacy setting "Allow direct messages from server members" being off for the servers you share, or the user not sharing any server with the bot at all. Users who have blocked the bot also produce 50007.
There is nothing the bot can do to force delivery. This is a user choice and Discord enforces it. The right response is graceful degradation: fall back to a channel message, an ephemeral interaction reply, or a note that the user must enable DMs.
Bots frequently see this at scale during welcome DMs and verification flows, and it is the reason mass-DM features have low delivery rates. It is not related to the bot's own permissions in any guild.
The delivery matrix has only a few rows, and the bot can influence none of them. User shares a server with the bot and allows DMs from server members (the default): the DM is delivered. User turned off "Allow direct messages from server members" for that specific server, or turned off the global default in Privacy & Safety: 50007. User no longer shares any server with the bot: 50007 no matter what their settings say, because the setting is evaluated against mutual servers. User blocked the bot: 50007, indistinguishable from the privacy setting. Target is another bot or a webhook pseudo-user: that is 50033 Invalid Recipient(s), not 50007. Discord deliberately returns the same code for "privacy setting" and "blocked" so senders cannot probe which one applies, which means your handling must be generic: mark the user as unreachable and offer an in-channel alternative.
What it looks like
{
"message": "Cannot send messages to this user",
"code": 50007
}Why it happens
- User has DMs from server members disabled, globally or for the shared server
- User and bot no longer share any guild
- User has blocked the bot
- User's account is restricted or deleted
- Bot attempting to DM another bot (bots cannot DM bots)
How to fix Discord error 50007
- 1Catch 50007 and fall back: reply ephemerally in the channel where the user interacted, or post a short notice in the channel
- 2Tell the user how to enable DMs: User Settings > Privacy & Safety, or Server > Privacy Settings > Allow direct messages
- 3Confirm the bot and user share at least one guild
- 4Do not retry; the result will not change until the user acts
- 5Track delivery failures per user so you stop attempting DMs that always fail
How to stop it recurring
Design features so DMs are an enhancement, not a requirement. Deliver verification links, codes and receipts as ephemeral interaction responses, which reach the user regardless of DM settings. Where a DM is genuinely needed, ask the user to DM the bot first so the channel is user-initiated.
Welcome-DM and verification flows should measure their 50007 rate; above a few percent is normal, and mass DMs push it far higher while also tripping 40003. The DM section of Discord bot not responding covers the intent and partials setup needed to receive DMs in the first place.
Official reference: Discord Developer Docs - Opcodes and status codes. See all Discord error codes or the Discord limits and quotas.
Related codes
Error 50007 - quick answers
What does Discord error 50007 mean?
The bot opened (or already had) a DM channel with the user, but the user cannot receive DMs from your bot. The most common reason is the user's privacy setting "Allow direct messages from server members" being off for the servers you share, or the user not sharing any server with the bot at all. Users who have blocked the bot also produce 50007. There is nothing the bot can do to force delivery.
How do I fix Discord error 50007?
1. Catch 50007 and fall back: reply ephemerally in the channel where the user interacted, or post a short notice in the channel 2. Tell the user how to enable DMs: User Settings > Privacy & Safety, or Server > Privacy Settings > Allow direct messages 3. Confirm the bot and user share at least one guild 4. Do not retry; the result will not change until the user acts 5. Track delivery failures per user so you stop attempting DMs that always fail
Should I retry after error 50007?
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.