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') {
}
}
},
};
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
5 Replies
Unknown User
Unknown User2y ago
Message Not Public
Sign In & Join Server To View
MrEthλn
MrEthλn2y ago
MrEthλn
MrEthλn2y ago
Oh
MrEthλn
MrEthλn2y ago
MrEthλn
MrEthλn2y ago
.addFields(
{ name: '**Secuirty Proceedure**', value: `${defcon5["security"]}` },
)
.addFields(
{ name: '**Secuirty Proceedure**', value: `${defcon5["security"]}` },
)
34-36 I am not very good at updating stuff yeah, takes me a while to do that could it be the value? CombinedPropertyError (1) Received one or more errors input[0] | CombinedPropertyError (1) | Received one or more errors | | input.value | | ValidationError > s.string | | Expected a string primitive | | | | Received: | | | undefined const { defcon1, defcon2, defcon3, defcon4, defcon5 } = require('../config.json');
{
"clientId": "943494797237293116",

--some removed

"defcon4": {
"id": 4,
"description": "Tension is present but, no war is imminent",
"secuirity": "Hightened security on borders, keep eyes out for scout craft",
"colour": "#cc00ff"
},
"defcon5": {
"id": 5,
"description": "No known danger",
"secuirity": "Normal procedure ",
"colour": "#0000ff"
}
}
{
"clientId": "943494797237293116",

--some removed

"defcon4": {
"id": 4,
"description": "Tension is present but, no war is imminent",
"secuirity": "Hightened security on borders, keep eyes out for scout craft",
"colour": "#cc00ff"
},
"defcon5": {
"id": 5,
"description": "No known danger",
"secuirity": "Normal procedure ",
"colour": "#0000ff"
}
}
oh, do i need to get it in the addfields differently, as it returns undefined while the rest return the right thing
.addFields(
{ name: '**Secuirty Proceedure**', value: `${defcon5["security"]}` },
)
.addFields(
{ name: '**Secuirty Proceedure**', value: `${defcon5["security"]}` },
)
no nvm i just didnt ssave the thing thank you