简体   繁体   中英

Why i get “ ',' expected ts1005” in Visual Studio Code when i am creating a bot in discord

im coding a discord bot and i change some field, and when i do that i have the error ',' expected ts1005 on line 75,1, can you guys check my code?,i dont know how to fix it, i try all;-;, help me, and i dont know what to say to post this because this thing its saying me the post its so much code and i dont write;-;

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) => {
      //bucle infinito
      if (!message.content.startsWith(prefix)) return;
      if (message.author.bot) return;

      if (message.content.startsWith("ATIS JSLL")) {

        message.channel.send("ATIS For JSLL:")
        message.channel.send("Information for Airport:JSLL")
        message.channel.send("Information:Zulu")
        message.channel.send("Time:15:51:02 Z")
        message.channel.send("Active runways:22,04")
        message.channel.send("Wind:230@30")
        message.channel.send("Clouds:Scattered around 4,500feet")
        message.channel.send("Visibility:>15km")
        message.channel.send("Remarks:None")
        message.channel.send("Tower frequency:168.20")
        message.channel.send("Ground Frequency:168.30")
        message.channel.send("Delivery frequency:168.40")
        message.channel.send("Centre frequency:168.50")
        message.channel.send("Emergency frequency:168.60")

        message.channel.send("ATIS is constantly changing so please be advised all pilots in the active frequencies")
      }
      if (message.content.startsWith("ATIS JTPH")) {
        message.channel.send("ATIS For JTPH:")
        message.channel.send("Information for Airport:JTPH")
        message.channel.send("Information:Zulu")
        message.channel.send("Time:17:39:02 Z")
        message.channel.send("Active runways:09L,27R,09R,27L")
        message.channel.send("Wind:270@12")
        message.channel.send("Clouds:Scattered around 2,500feet maintaining")
        message.channel.send("Visibility:>17Km")
        message.channel.send("Remarks:None")
        message.channel.send("Tower frequency:121.20")
        message.channel.send("Ground Frequency:121.30")
        message.channel.send("Delivery frequency:121.40")
        message.channel.send("Centre frequency:121.50")
        message.channel.send("Emergency frequency:121.60")

        message.channel.send("ATIS is constantly changing so please be advised all pilots in the active frequencies")
      }
      if (message.content.startsWith(prefix + "send Emergency services")) {
        message.channel.send("Sending the emergency services to you!")
      }
      if (message.content.startsWith(prefix + "ATIS JTPH")) {
        const embed = new Discord.RichEmbed()
          .setColor("#3b83bd")
          .setDescription("This is ATIS for JTPH.")
          .setTimestamp()
          .addField("Information for Airport:JTPH.", true)
          .addField("Information:Zulu.", true)
          .addField("Time:13:29:02 Z", true)
          .addField("Active runways:09L, 09R, 27L, 27R", true)
          .addField("Wind:230@12", true
          .addField("Clouds:Clear", true)
          .addField("Visibility:>20km", true)
          .addField("Remarks:None")
          .addField("Tower frequency:121.20", true)
          .addField("Ground Frequency:121.30", true)
          .addField("Delivery frequency:121.40", true)
          .addField("Centre frequency:121.50", true)
          .addField("Emergency frequency:121.60", true)
          .addBlankField(true)
          .addField("ATIS is constantly changing so please be advised all pilots in the active frequencies", true), message.channel.send(embed)
      }
    }); client.login("<login token>")

Because you have a comma that shouldn't be here:

,message.channel.send(embed)

It should just be:

message.channel.send(embed)

And you're also missing a closing parenthesis here:

.addField("Wind:230@12", true
// Should be:
.addField("Wind:230@12", true)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM