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

96
Views
Discord APIerror

I am having issues with sending discord embeds. This is my code:

module.exports = {
    name: 'tiktok',
    description: "sends tiktok link",
    execute(message, args, Discord) {
        const newEmbed = new Discord.MessageEmbed()
        .setColor('#228B22')
        .setTitle('Tiktok')
        .setURL('https://www.tiktok.com/@elcattuccino?lang=en')
        .setDescription('tiktok link for the discord server')
        .addFields(
            {name: 'Tiktok', value:'heres the tiktok link'},
        )
        .setImage('https://cdn.discordapp.com/avatars/752212130870329384/6a16609eafc28f95ad8f64e80ffcc24e.png?size=80')
        .setFooter('check out the tiktok');
        
        message.channel.send(newEmbed);
    }
}

But I get this error:

throw new DiscordAPIError(data, res.status, request); ^

DiscordAPIError: Cannot send an empty message at RequestHandler.execute (C:\Users\willm\OneDrive\Desktop\Discord Bot\node_modules\discord.js\src\rest\RequestHandler.js:349:13) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async RequestHandler.push (C:\Users\willm\OneDrive\Desktop\Discord Bot\node_modules\discord.js\src\rest\RequestHandler.js:50:14) at async TextChannel.send (C:\Users\willm\OneDrive\Desktop\Discord Bot\node_modules\discord.js\src\structures\interfaces\TextBasedChannel.js:172:15) { method: 'post', path: '/channels/910099863180550144/messages',
code: 50006, httpStatus: 400, requestData: { json: { content: undefined, tts: false, nonce: undefined, embeds: undefined, components: undefined, username: undefined, avatar_url: undefined, allowed_mentions: undefined, flags: undefined, message_reference: undefined, attachments: undefined, sticker_ids: undefined }, files: [] } }

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

0

If you're using discord.js v13, you should send an embed like this as you can send up to 10 embeds now:

message.channel.send({ embeds: [newEmbed] });

The embed option was removed and replaced with an embeds array, which must be in the options object. More info

about 4 years ago · Juan Pablo Isaza Report

0

Use message.channel.send({ embeds: [newEmbed] });

Also field has changed

.addField('LINK', '[LINK](TIKTOK LINK)', true) like this

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!