Dm user Error

Been getting this error and can not seem to see why it won't work
DiscordAPIError[50007]: Cannot send messages to this user
at handleErrors (/home/container/node_modules/@discordjs/rest/dist/index.js:640:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async SequentialHandler.runRequest (/home/container/node_modules/@discordjs/rest/dist/index.js:1021:23)
at async SequentialHandler.queueRequest (/home/container/node_modules/@discordjs/rest/dist/index.js:862:14)
at async REST.request (/home/container/node_modules/@discordjs/rest/dist/index.js:1387:22)
at async DMChannel.send (/home/container/node_modules/discord.js/src/structures/interfaces/TextBasedChannel.js:157:15)
at async Client.<anonymous> (/home/container/index.js:80:9) {
requestBody: {
files: [],
json: {
content: undefined,
tts: false,
nonce: undefined,
embeds: [Array],
components: undefined,
username: undefined,
avatar_url: undefined,
allowed_mentions: undefined,
flags: undefined,
message_reference: undefined,
attachments: undefined,
sticker_ids: undefined,
thread_name: undefined
}
},
rawError: { message: 'Cannot send messages to this user', code: 50007 },
code: 50007,
status: 403,
method: 'POST',
url: 'https://discord.com/api/v10/channels/1093025064749908138/messages'
}
DiscordAPIError[50007]: Cannot send messages to this user
at handleErrors (/home/container/node_modules/@discordjs/rest/dist/index.js:640:13)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async SequentialHandler.runRequest (/home/container/node_modules/@discordjs/rest/dist/index.js:1021:23)
at async SequentialHandler.queueRequest (/home/container/node_modules/@discordjs/rest/dist/index.js:862:14)
at async REST.request (/home/container/node_modules/@discordjs/rest/dist/index.js:1387:22)
at async DMChannel.send (/home/container/node_modules/discord.js/src/structures/interfaces/TextBasedChannel.js:157:15)
at async Client.<anonymous> (/home/container/index.js:80:9) {
requestBody: {
files: [],
json: {
content: undefined,
tts: false,
nonce: undefined,
embeds: [Array],
components: undefined,
username: undefined,
avatar_url: undefined,
allowed_mentions: undefined,
flags: undefined,
message_reference: undefined,
attachments: undefined,
sticker_ids: undefined,
thread_name: undefined
}
},
rawError: { message: 'Cannot send messages to this user', code: 50007 },
code: 50007,
status: 403,
method: 'POST',
url: 'https://discord.com/api/v10/channels/1093025064749908138/messages'
}
4 Replies
d.js toolkit
d.js toolkit2y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
d.js docs
d.js docs2y ago
DiscordAPIError: Cannot send messages to this user Your bot is trying to send a DM to a user, but failed to do so: • The user has DMs disabled or the bot blocked • The user no longer shares a guild with the bot (make sure to send informational DMs before banning/kicking) • The bot is trying to DM itself or another bot Note: You cannot check if you can send a DM beforehand but have to handle the rejection case
X_DigitalNinja
X_DigitalNinjaOP2y ago
The dms are on. on the other account
lupus
lupus2y ago
The bot needs to be in a mutual server with the account and DMs for that server must be on
Want results from more Discord servers?
Add your server