我正在使用 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);
},
};
这是命令代码,如果我需要我把主脚本的代码也贴出来。