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

259
Views
res.join is not a function

I've been getting this error while trying to code a discord bot in discord.js. The Bot is being used to check for the status of a discord server.

Error:

D:\MinecraftBot\commands\mcserver.js:13
        .then((res) => res.join())
                           ^

TypeError: res.join is not a function
    at D:\MinecraftBot\commands\mcserver.js:13:28

Code In Question:

module.exports = {
    name: "mcserver",
    description: "Get info about a Minecraft Server",
    usage: "mcserver <ip>",
    run: async (client, message, args) => {

        let ip = args[0];

        fetch("https://api.mcsrvstat.us/2/"+args[0])
        .then((res) => res.join()) // <-------- This Line Is Producing The Error
        .then((body) => {
            if(body.online === false) {
                let oneembed = new discord.MessageEmbed()
                .setColor('RANDOM')
                .setAuthor("MC SERVER", message.guild.iconURL ({ dynamic: true }))
                .addField("Status","<a:Offline:766303914654957610>")
                .setTimestamp();
                message.channel.send(oneembed)
            }
            else {
                let embed = new discord.MessageEmbed()
                .setColor('RANDOM')
                .setThumbnail(`https://mc-api.net/v3/server/favicon/${args[0]}`)
                .setAuthor("Mc Server", message.guild.iconURL({ dynamic: true }))
                .addField("Status", "<a:Online:766303827850690600>")
                .addField("IP", body.ip)
                .addField("Hostname", body.hostname)
                .addField("Players", `${body.players.online}/${body.players.max}`)
                .addField("Software", body.software)
                .addField("Version", body.version)
                .addField("Motd", `${body.motd.clean[0]}\n${body.motd.clean[1]}`)
                .setTimestamp()
                .setImage(`http://status.mclive.eu/${args[0]}/${args[0]}/25565/banner.png`)
                message.channel.send(embed)
            }
        })

    }
}

The Data It's Requesting Is Here: https://api.mcsrvstat.us/2/hypixel.net

about 4 years ago · Juan Pablo Isaza
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!