Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

98
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda