Reputation: 97
Hello needed to send PM to users, i tried this command
msg.author.send("text")
But when i tries to run this command i get this error
DiscordAPIError: Cannot send messages to this user
at RequestHandler.execute (C:\Users\GreXLin85\Desktop\Projelerim\JS\project\node_modules\discord.js\src\rest\RequestHandler.js:154:13)
at processTicksAndRejections (node:internal/process/task_queues:93:5)
at async RequestHandler.push (C:\Users\GreXLin85\Desktop\Projelerim\JS\project\node_modules\discord.js\src\rest\RequestHandler.js:39:14) {
method: 'post',
path: '/channels/782746558520360960/messages',
code: 50007,
httpStatus: 403
}
Upvotes: 0
Views: 60
Reputation: 71
There could be multiple reasons:
To avoid this problem you can add a try{} catch{}
block
Upvotes: 1