Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange "DiscordAPIError: Cannot send messages to this user" #6917

Closed
idkroff opened this issue Oct 29, 2021 · 1 comment
Closed

Strange "DiscordAPIError: Cannot send messages to this user" #6917

idkroff opened this issue Oct 29, 2021 · 1 comment

Comments

@idkroff
Copy link

idkroff commented Oct 29, 2021

Issue description

msg.author.send({ embeds: [msgEmbed], components: [row] }) .catch(err => console.error(err))
gives "DiscordAPIError: Cannot send messages to this user" in console, but in fact bot sends the message to user and it succesfully delivers.
What can cause this?

Code sample

client.on('messageCreate', msg => {
  if (msg.channel.type === 'DM') {
    ...
    msg.author.send({ embeds: [msgEmbed], components: [row] })
    .catch(err => console.error(err))
  }
});

discord.js version

13.2.0

Node.js version

v17.0.1

Operating system

ubuntu 20

Priority this issue should have

Medium (should be fixed soon)

Which partials do you have configured?

CHANNEL, MESSAGE, REACTION

Which gateway intents are you subscribing to?

GUILDS, GUILD_MEMBERS, GUILD_MESSAGES, GUILD_MESSAGE_REACTIONS, DIRECT_MESSAGES

I have tested this issue on a development release

No response

@idkroff
Copy link
Author

idkroff commented Oct 29, 2021

My mistake, bot wa responding on bot's message

@idkroff idkroff closed this as completed Oct 29, 2021
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 25, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants