为什么这个 Dm 命令对某些 id 不起作用?不和谐js

时间:2021-07-13 07:36:43

标签: javascript discord bots

    const devs = [
        'user1ID',
        'user2ID',
        'user3ID',
        'user4ID'
    ]

    if (devs.includes(message.author.id)) {
        const target = client.users.cache.get(args[0]);

        let payload = message.content.slice(8)

        if (!target) return message.channel.send("User not found");

        client.users.cache.get(target.id).send(payload)
        message.channel.send("DM has been Sent :tick:")
        .catch(() => message.lineReply("User has DMs closed or has no mutual servers with the bot"));
    }
    else {
        message.channel.send("You don't have permission to use this command")
    }

它说找不到某些 ID 和其他 ID 的用户,它成功发送了 dm,并且在发送时也发送了 ID。请帮帮我。

0 个答案:

没有答案