ReferenceError:未定义mesagge

时间:2019-10-26 03:26:14

标签: bots discord

帮助!,我为不和谐创建了一个bot,我给它加了一个前缀,所以当我想使用命令如何在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")

1 个答案:

答案 0 :(得分:0)

这是您键入mesagge而不是消息的错字