Home > Software design >  [Discord.js]MessageEmbed field values must be non-empty strings
[Discord.js]MessageEmbed field values must be non-empty strings

Time:12-12

I have A Some Problem.
I spent three days trying to fix this, but I didn't succeed.
I need your help.

My Error Code is

C:\Discord Bot\My BOT\node_modules\discord.js\src\util\Util.js:415
    if (typeof data !== 'string') throw new error(errorMessage);
                                        ^

RangeError [EMBED_FIELD_VALUE]: MessageEmbed field values must be non-empty strings.
    at Function.verifyString (C:\Discord Bot\My BOT\node_modules\discord.js\src\util\Util.js:415:41)
    at Function.normalizeField (C:\Discord Bot\My BOT\node_modules\discord.js\src\structures\MessageEmbed.js:518:19)
    at C:\Discord Bot\My BOT\node_modules\discord.js\src\structures\MessageEmbed.js:539:14
    at Array.map (<anonymous>)
    at Function.normalizeFields (C:\Discord Bot\My BOT\node_modules\discord.js\src\structures\MessageEmbed.js:538:8)
    at MessageEmbed.addFields (C:\Discord Bot\My BOT\node_modules\discord.js\src\structures\MessageEmbed.js:324:42)
    at MessageEmbed.addField (C:\Discord Bot\My BOT\node_modules\discord.js\src\structures\MessageEmbed.js:315:17)
    at C:\Discord Bot\My BOT\src\commands\vatsim\atc.js:57:6
    at processTicksAndRejections (node:internal/process/task_queues:96:5) {
  [Symbol(code)]: 'EMBED_FIELD_VALUE'
}

My Code is

const Discord = require("discord.js")
const fetch = require('node-fetch');

module.exports.run = async (client, message, args) => {
    var ICAO = message.content.split(' ').slice(1).join(' ').toUpperCase()
    
    fetch(`https://data.vatsim.net/v3/vatsim-data.json`)
    .then(response => response.json())
    .then(data => {

    let atc = data.controllers.find(Data => Data.callsign === `${ICAO}`);
    let cid = atc.cid
    let name = atc.name
    let facility = atc.facility
    let callsign = atc.callsign
    let frequency = atc.frequency
    let rating = atc.rating
    let server = atc.server
    let range = atc.visual_range
    let atis = atc.text_atis
    let last_update = atc.last_updated
    let logon_time = atc.logon_time
    
    const ok = new Discord.MessageEmbed()
    .setColor('GREEN')
    .setTitle(`           
  • Related