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

379
Views
discord.js RangeError [MESSAGE_CONTENT_TYPE]: Message content must be a non-empty string
const { Client }  = require('discord.js')
const client = new Client({intents:32767})
const { token } = require('./config.json')
var timer = 0

setInterval(
    () => timer ++,
    1000
);

client.once('ready',()=>{
    console.log("bot ready")
})

client.on('messageCreate' , message=>{
    if(message.content == "!uptime"){
        console.log(timer)
        message.reply(timer)
    }
})

client.login(token)

error log : RangeError [MESSAGE_CONTENT_TYPE]: Message content must be a non-empty string.

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

0

It's because the content you want to send is a number while reply only accepts a string (or an object).

Try to convert your timer variable to a string:

message.reply(timer.toString())

Or:

message.reply(`${timer}`)
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!