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

310
Views
MessageEmbed author name must be a string

I've tried to create an embed message on Discord base on this discordjs.guide, and ran into this problem:

RangeError [EMBED_AUTHOR_NAME]: MessageEmbed author name must be a string.
    at Function.verifyString (D:\Kien Thuc\IT\HTML CSS JAVASCRIPT\DiscordBot\node_modules\discord.js\src\util\Util.js:413:41)
    at MessageEmbed.setAuthor (D:\Kien Thuc\IT\HTML CSS JAVASCRIPT\DiscordBot\node_modules\discord.js\src\structures\MessageEmbed.js:356:32)
    at Object.execute (D:\Kien Thuc\IT\HTML CSS JAVASCRIPT\DiscordBot\commands\example-embed.js:16:14)
    at Client.<anonymous> (D:\Kien Thuc\IT\HTML CSS JAVASCRIPT\DiscordBot\index.js:24:17)
    at Client.emit (node:events:390:28)
    at InteractionCreateAction.handle (D:\Kien Thuc\IT\HTML CSS JAVASCRIPT\DiscordBot\node_modules\discord.js\src\client\actions\InteractionCreate.js:70:12)
bsocket\WebSocketShard.js:443:22)    at WebSocketShard.onMessage (D:\Kien Thuc\IT\HTML CSS JAVASCRIPT\DiscordBot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:300:10) {  [Symbol(code)]: 'EMBED_AUTHOR_NAME'
}

Here's my code:

const {
    SlashCommandBuilder
} = require('@discordjs/builders');
const {
    MessageEmbed
} = require('discord.js');
module.exports = {
    data: new SlashCommandBuilder()
        .setName('embeds')
        .setDescription('embeds'),
    async execute(interaction) {
        const exampleEmbed = new MessageEmbed()
            .setColor('#0099ff')
            .setTitle('Some title')
            .setURL('https://discord.js.org/')
            .setAuthor({
                name: 'Some name',
                iconURL: 'https://i.imgur.com/AfFp7pu.png',
                url: 'https://discord.js.org'
            })
            .setDescription('Some description here')
            .setThumbnail('https://i.imgur.com/AfFp7pu.png')
            .addFields({
                name: 'Regular field title',
                value: 'Some value here'
            }, {
                name: '\u200B',
                value: '\u200B'
            }, {
                name: 'Inline field title',
                value: 'Some value here',
                inline: true
            }, {
                name: 'Inline field title',
                value: 'Some value here',
                inline: true
            }, )
            .addField('Inline field title', 'Some value here', true)
            .setImage('https://i.imgur.com/AfFp7pu.png')
            .setTimestamp()
            .setFooter('Some footer text here', 'https://i.imgur.com/AfFp7pu.png');
        await interaction.reply({
            embeds: [exampleEmbed]
        });
    },
};

I just don't understand, the key "name" here has a string value: 'some name', so why can't it run? My temporary solution here is to wipe out that Author part and the code runs smooth as heck.

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

0

I had the same issue - what fixed it for me was removing the {} inside of .setAuthor() as well as omitting name:, iconURL:, and url:.

So, it would look like this:

.setAuthor('Some name','https://i.imgur.com/AfFp7pu.png','https://discord.js.org')

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!