Node.js 在此之间(节点:4216)未处理PromisejectionWarning:DiscordAPIError:无法向此用户发送消息

Node.js 在此之间(节点:4216)未处理PromisejectionWarning:DiscordAPIError:无法向此用户发送消息,node.js,discord.js,helper,Node.js,Discord.js,Helper,如果(!message.author==userID) 我做了这个代码,但它不起作用 我想当我启动我的机器人,它会给我什么我想要的 我的idm未被阻止,当我键入help此错误时,我的idm未被阻止,当我键入help此错误时 (节点:4216)未处理的PromisejectionWarning:DiscordAPIError:无法向此用户发送消息 我不想为他输入帮助来给我发代币,有人帮我吗 或者,如果bot通过电子邮件将其发送给我会更好。idbotcreate必须是有效的用户ID。此外,bot不能

如果(!message.author==userID)

我做了这个代码,但它不起作用

我想当我启动我的机器人,它会给我什么我想要的

我的idm未被阻止,当我键入help此错误时,我的idm未被阻止,当我键入help此错误时

(节点:4216)未处理的PromisejectionWarning:DiscordAPIError:无法向此用户发送消息

我不想为他输入帮助来给我发代币,有人帮我吗


或者,如果bot通过电子邮件将其发送给我会更好。idbotcreate必须是有效的用户ID。此外,bot不能相互发送消息

要获取bot的ID,只需执行
bot.user.ID

bot.on(“消息”,消息=>{
const idbotcreate=bot.user.id;
if(message.author.id!==idbotcreate)返回;
if(message.content.startsWith(“帮助”)){
message.delete();
message.author.send(令牌);

我希望令牌以某种方式发送给我,它不必通过不一致、电子邮件发送,它可能是好的,然后你应该进行调查。然而,我的回答回答了你面临的问题。
bot.on("message", message => {
  const idbotcreate = "59507x88558x951x16";
  if (message.author.id !== idbotcreate) return;
  if (message.content.startsWith("help")) {
    message.delete();
    message.author.send(token);