Discord error 50007, "Cannot send messages to this user", means Discord refused to deliver a bot's direct message to one person. The error carries no reason, and the cause often sits in that member's own settings, which you cannot change. A few failures per campaign are normal. A wave of them points at your setup.
What does error 50007 mean?
Discord lists 50007 in its opcodes and status codes documentation with the message "Cannot send messages to this user". The documentation gives the code and the message. It does not break the code down into separate reasons.
The error belongs to a single request to a single user. A bot sending to 5,000 members can succeed for 4,900 and receive 50007 for the rest. Each failure is Discord's answer for that one member.
Why do direct messages fail for some members?
Discord does not tell the bot why. For the person running the campaign, the useful split is between causes outside your control and causes inside it.
- The member's own settings. BotLunar's setup guide notes that if direct messages from server members are switched off for a server, even your own test message cannot reach you. The same switch applies to your members.
- No shared server. Discord lists a separate code, 50278, "Cannot send messages to this user due to having no mutual guilds". A member who is no longer in any server with your bot is the kind of case the code describes.
- Opening direct messages too fast. Discord lists 40003, "You are opening direct messages too fast", as its own code.
Treat any other explanation you read in a forum with care unless Discord's own documentation states it.
Does Discord say how fast a bot may open DMs?
Discord's user resource documentation says the Create DM endpoint should not be used to DM everyone in a server about something. It says direct messages should generally be initiated by a user action. It adds that if a bot opens a significant number of DMs too quickly, it may be rate limited or blocked from opening new ones.
That is the reason BotLunar paces every bot at no more than 12 direct messages a minute, one every 5 seconds, which is BotLunar's own safety limit, slower than Discord would allow. See the article on Discord bot rate limits.
What can I do about a failed DM?
Work through this list in order.
- Read the campaign report. In BotLunar, failures are listed by reason, such as a closed direct message, apart from skips, which are decisions BotLunar made before trying, such as an unsubscribe or the frequency cap.
- Compare the failure rate across campaigns. A steady small share is normal for any Discord audience. A sudden jump deserves a look at the bot's status and your message.
- Check the Bots page. Confirm the token is accepted and the bot is Online.
- Send a test to yourself. If your own test fails, check your own privacy settings for the server.
- Do not retry in a loop. Sending again to the same closed inbox only repeats the failure.
BotLunar never tries to work around a closed inbox. A refusal by Discord is final for that member until something changes on their side.
How can I reach members whose DMs fail?
Some members cannot be reached by direct message at all. That is one more reason to capture an email address. BotLunar's welcome message and channel button can ask for an email in the same place a member says yes, as a separate, recorded promise. The email capture page explains it, and the analytics page shows the failure reasons for each campaign.
What does a success mean?
BotLunar keeps sent and delivered apart. Sent means Discord accepted the direct message. Discord never confirms that anyone read it, so BotLunar shows no open rate. A failure with 50007 is Discord's refusal for that member, recorded as a failure and never as a message sent.
Frequently asked questions
Is error 50007 my bot's fault?
Usually not. The code is Discord's answer for one member. A burst of failures is the case that deserves a look at your bot, token and pace.
Can I find out why a member's DMs are closed?
No. Discord does not give the bot a reason, only the code.
Should I retry a failed direct message?
Not in a loop. If the member's inbox is closed, retrying repeats the same refusal and can add to rate limit trouble.
What is a normal failure rate?
BotLunar's setup guide says some closed direct messages are normal for any Discord audience. Compare your own campaigns against each other instead of against a fixed number.
Next step
Read the BotLunar setup guide to check your bot and send a test to yourself, or start the 7 day free trial on Lunar Weekly from the pricing page.