ReferenceError:未定义消息
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ReferenceError:未定义消息相关的知识,希望对你有一定的参考价值。
[帮助!,我为不和谐创建了一个机器人,我给它加了一个前缀,所以当我想使用命令如何在VSC终端中的不和谐中使用“(a.richembed)”时出现错误,我得到了错误“ ReferenceError :mesagge未定义”,我不知道如何解决它,请帮帮我!,这是我的代码
const Discord = require("discord.js");
const client = new Discord.Client();
let prefix = "a."
client.on("ready", () => {
console.log("Ready to give Atis");
});
client.on("message", (message) => {
if(message.content.startsWith("ATIS JTPH")) {
message.channel.send("Information for airport: JTPH--------- Information: Zulu--------- Time: .......... (eg 16:45:00z)--------- Active Runways: 09L, 09R, 27L, 27R--------- WInd: .....@... (eg 360@15)--------- Clouds:Clear--------- Visibility: >20KM--------- Remarks:None--------- Tower Frequency: 121.20--------- Ground Frequency: 121.30--------- Delivert Center: 121.40--------- Center Frequency: 121.50--------- Emergency Frequency 121.60.");
}
if(message.content.startsWith(prefix+ "Help!")){
message.channel.send("Sending the emergency services to you!")
}
if(mesagge.channel.send.startsWith(prefix,"richembed")){
const embed = new Discord.RichEmbed()
.setTitle("What i can do?")
.setAuthor(message.author.username, message.author.displayAvatarURL)
.setColor(0x00AE86)
.setDescription("Well, mainly I'm designed by my creator Carlos and he coded me to be able to give information to the pilots who need it.")
.setFooter("They will ask: Why is that bot there and why does it have those roles? well, very simple, if you say ATIS JTPH I will tell you a few things about the defined airport such as JTPH!", client.user.avatarURL)
.setImage(message.author.displayAvatarURL)
.setThumbnail(message.author.displayAvatarURL)
.setTimestamp()
.setURL("https://github.com/CraterMaik")
.addField("These texts are still configured by my creator, please be patient!.", true)
.addField("These texts are still configured by my creator, please be patient!", true)
.addBlankField(true)
.addField("These texts are still configured by my creator, please be patient!.", true);
message.channel.send(embed)
}
});
client.login("NjM1MTk5NzE1NTUzODM3MDg2.XbO1Sw.mappUgFXIYeqj5_FgYFQ30TBDto")
答案
它是您键入消息而不是消息的错字
以上是关于ReferenceError:未定义消息的主要内容,如果未能解决你的问题,请参考以下文章
Discord.js ReferenceError:未定义消息
未捕获的 ReferenceError:“$ 未定义”[重复]
元素 UI 测试抛出 ReferenceError: 消息未定义