Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

240
Views
Discord bot not able to create the embed RangeError [EMBED_FIELD_VALUE]: MessageEmbed field values must be non-empty strings
const {Client, RichEmbed, Intents, MessageEmbed } = require('discord.js'); 

 
const bot = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES] });
 
 
const token = 'token is a secret';
 
const PREFIX = '!';
 
bot.on('ready', () =>{
    console.log('Bot has come online.');
});
 
bot.on('messageCreate', message =>{
 
    
    let args = message.content.substring(PREFIX.length).split(' ')
 
    switch(args[0]){
        case 'mc':
            
            const ping = require('minecraft-server-util')
 
 
            ping.status('ip', { port: port})
             .then((response)=>{
                
                const Embed = new MessageEmbed()
                .setTitle('Server Status', )
                .addField('Server IP', response.host)
                .addField('Server Version', response.version)
                .addField('Online Players', response.onlinePlayers)
                .addField('Max Players', response.maxPlayers)
                
                message.channel.send({ embeds: [Embed] });
            })
            .catch((error)=>{console.error(error);});
        break
 
    }
 
    })
 
bot.login(token);

I am coding a discord bot that sends the status of my minecraft server when the assigned command is issued. But for some reason it is not able to create the embed. This is the error i am getting: RangeError [EMBED_FIELD_VALUE]: MessageEmbed field values must be non-empty strings. I tried to google this error but i couldn't understand clearly. Please tell me where i have gone wrong and how should i correct it. :(

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Try this:

.setTitle('Server Status')
.addField('Server IP', `** ** ${response.host}`)
.addField('Server Version', `** ** ${response.version}`)
.addField('Online Players', `** ** ${response.onlinePlayers}`)
.addField('Max Players', `** ** ${response.maxPlayers}`)
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!