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

387
Views
Uncaught RangeError [MESSAGE_CONTENT_TYPE]: Message content must be a non-empty string

I am trying to make a gpt3 chatbot but I keep getting this error on Discord.js v11.

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

client.on("messageCreate", function (message) {
    if (message.author.bot) return;
    prompt += `You: ${String(message.content)}\n`;
    (async () => {
        const gptResponse = await openai.complete({
            engine: 'davinci',
            prompt: prompt,
            maxTokens: 60,
            temperature: 0.3,
            topP: 0.3,
            presencePenalty: 0,
            frequencyPenalty: 0.5,
            bestOf: 1,
            n: 1,
            stream: false,
            stop: ['\n', '\n\n']
        });
        message.reply(String(gptResponse.data.choices[0].text.substring(5)));
        prompt += `${gptResponse.data.choices[0].text}\n`;
    })();
 });            

client.login(process.env.BOT_TOKEN);
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!