Skip to content

Incorrect 50001s returned when sending DMs from a user-installed application #7666

Open
@LJNeon

Description

@LJNeon

Description

Attempts to send a message to a specific user's DMs will result in a 50001 Missing Access even when retried. Restarting the bot resolves the issue, the exact same message will correctly send to the exact same user. This happens to seemingly random users, but does happen consistently. It's rather annoying that I need to restart my bot constantly to allow it to function correctly.

Steps to Reproduce

I can consistently reproduce this with my bot, and am more than happy to supply any necessary information for this. My application ID is 1010660593847521352 and the bot connects via the gateway with no intents.

Expected Behavior

No 50001s are returned since access to the user's DMs is not missing.

Current Behavior

Some seemingly random users will be unable to receive DMs from the bot due to 50001 errors. Restarting the bot allows those users to receive DMs again despite no other changes being made.

Screenshots/Videos

A snippet of the error logs
{"level":50,"time":1751311692879,"err":{"type":"DiscordAPIError","message":"Missing Access","requestBody":{"files":[],"json":{"tts":false,"enforce_nonce":false,"embeds":[{"title":"Time to vote!","description":"It's been at least 12 hours since you voted for me on [**top.gg**](https://top.gg/bot/1010660593847521352/vote)! You can now vote for me again to show further support!\n","footer":{"text":"You're currently #1 on the /voters leaderboard!"},"color":5759487}],"allowed_mentions":{"parse":[],"replied_user":false}}},"rawError":{"type":"Object","message":"Missing Access","code":50001},"code":50001,"status":403,"method":"POST","url":"https://discord.com/api/v10/channels/1346501313315344564/messages"},"msg":"Missing Access"}
{"level":50,"time":1751311702965,"err":{"type":"DiscordAPIError","message":"Missing Access","requestBody":{"files":[],"json":{"tts":false,"enforce_nonce":false,"embeds":[{"title":"Time to vote!","description":"It's been at least 12 hours since you voted for me on [**top.gg**](https://top.gg/bot/1010660593847521352/vote)! You can now vote for me again to show further support!\n","footer":{"text":"You're currently #1 on the /voters leaderboard!"},"color":5759487}],"allowed_mentions":{"parse":[],"replied_user":false}}},"rawError":{"type":"Object","message":"Missing Access","code":50001},"code":50001,"status":403,"method":"POST","url":"https://discord.com/api/v10/channels/1346501313315344564/messages"},"msg":"Missing Access"}
{"level":50,"time":1751311713042,"err":{"type":"DiscordAPIError","message":"Missing Access","requestBody":{"files":[],"json":{"tts":false,"enforce_nonce":false,"embeds":[{"title":"Time to vote!","description":"It's been at least 12 hours since you voted for me on [**top.gg**](https://top.gg/bot/1010660593847521352/vote)! You can now vote for me again to show further support!\n","footer":{"text":"You're currently #1 on the /voters leaderboard!"},"color":5759487}],"allowed_mentions":{"parse":[],"replied_user":false}}},"rawError":{"type":"Object","message":"Missing Access","code":50001},"code":50001,"status":403,"method":"POST","url":"https://discord.com/api/v10/channels/1346501313315344564/messages"},"msg":"Missing Access"}
{"level":50,"time":1751311723212,"err":{"type":"DiscordAPIError","message":"Missing Access","requestBody":{"files":[],"json":{"tts":false,"enforce_nonce":false,"embeds":[{"title":"Time to vote!","description":"It's been at least 12 hours since you voted for me on [**top.gg**](https://top.gg/bot/1010660593847521352/vote)! You can now vote for me again to show further support!\n","footer":{"text":"You're currently #1 on the /voters leaderboard!"},"color":5759487}],"allowed_mentions":{"parse":[],"replied_user":false}}},"rawError":{"type":"Object","message":"Missing Access","code":50001},"code":50001,"status":403,"method":"POST","url":"https://discord.com/api/v10/channels/1346501313315344564/messages"},"msg":"Missing Access"}

A screenshot of the exact message (ID: 1389468049295544420) being sent immediately after the bot is restarted:
Image

This is in my DMs, so I can 100% confirm that I had the bot added as a user app AND shared a mutual server with DMs enabled (not that the later should be needed).

Client and System Information

Ubuntu 24.04.2 LTS
node.js v24.0.1
discord.js 14.21.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions