discord.js 报错 Invalid interaction application command 是什么原因?

我正在使用 discord.js 和 WOKCommands 中的使用斜线功能,但在discord中输入时,报错: Invalid interaction application command

代码如下:

const { MessageEmbed } = require("discord.js");

// Simple command for the message
module.exports = {
    name: "ping",
    slash: "both",
    testOnly: false,
    description: "Command to figure out what your current ping is. Also shows API Latency",
    // Executing the message commandexecute(client, message, cmd, args, Discord) {
        // Creating the Embed constconst newEmbed = new MessageEmbed()
            // ALL EMBED VALUES
            .setColor("#ffdbac")
            .setTitle("Ping")
            .setDescription("Pong! Latency is **" + (Date.now() - message.createdTimestamp) + "ms**. API Latency is **" + message.client.ws.ping + "ms**")
            .setThumbnail(`https://cometiclachlan.github.io/Uploads/pingpong-removebg.png`)
            .setTimestamp()
            .setFooter("v1.2", `https://cometiclachlan.github.io/Uploads/Checkpoint-removebg.png`);

        message.channel.send(newEmbed);
    },
};

这是命令代码,如果我需要我把主脚本的代码也贴出来。

阅读 1.2k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题