ReferenceError: сообщение не определено - PullRequest
0 голосов
/ 26 октября 2019

Help !, я создаю бота для разногласий, и я ставлю ему префикс, поэтому ошибка возникает, когда я хочу использовать команду как "(a.richembed)" в разногласиях в терминале VSC, я получаю ошибку "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 голосов
/ 26 октября 2019

Это опечатка, которую вы набрали вместо сообщения

...