我的命令将无法正常工作,就像无法被识别一样,但是我以与其他有效命令相同的格式编写了该命令。
这是命令处理程序代码:
//Other commands
} else if (command === "day") {
client.commands.get("day").execute(client, message, args);
}
这是我的“ day”命令代码:
module.exports = {
name: "day",
execute(client, message, args) {
if (message.author.roles.some(role => role.name === "Narrator")) {
console.log("Has Narrator");
let player = client.guild.roles.get("726355606440771646");
message.delete();
message.channel.overwritePermissions(player, { SEND_MESSAGES: true });
message.channel.send("<@726355606440771646> \n Discuss!");
} else {
console.log("Doesn't have Narrator");
message.channel.send("No perms").then(msg => {
msg.delete(3000);
});
}
}
};
我有没有发现错字?控制台甚至没有记录“有讲述人”或“没有讲述人”