Embed making errors

This is my command

const { Client, SlashCommandBuilder, EmbedBuilder  } = require('discord.js')
const { defcon1, defcon2, defcon3, defcon4, defcon5 } = require('../config.json');
    
    module.exports = {
        data: new SlashCommandBuilder()
            .setName('defcon')
            .setDescription('Defcon Controls')
        .addSubcommand(subcommand =>
        subcommand
            .setName('set')
            .setDescription('Set the defcon level')
      .addIntegerOption(option =>
        option
          .setName('level')
          .setDescription('Defcon level')
          .addChoices(
                    { name: '1' , value: 1 },
                    { name: '2', value: 2 },
                    { name: '3', value: 3 },
            { name: '4', value: 4 },
            { name: '5', value: 5 },
          )
          .setRequired(true)))
    .addSubcommand(subcommand =>
        subcommand
            .setName('reset')
            .setDescription('Sets the defcon to 5')),
        async execute(interaction, client) {
        const level = interaction.options.getInteger('level');
        const A = new EmbedBuilder()
          .setColor(defcon5["colour"])
          .setTitle('**Defcon '+defcon5["id"]+'**')
          .setDescription(defcon5["description"])
          .addFields(
              { name: '**Secuirty Proceedure**', value: `${defcon5["security"]}` },
          )
          .setTimestamp()
        if (interaction.options.getSubcommand() === 'set') {
          interaction.reply("Set the defcon to "+level)
          if (level === 5) {
            //delete past
            //upload new id
            client.channels.cache.get("1040646203454525602").send({ embeds: [A] });
          }
        if (interaction.options.getSubcommand() === 'reset') {
        }
        }
        },
    };

And it gives me this error and idk why
IMG_9708.png
Was this page helpful?