Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

DeprecationWarning: Passing strings for MessageEmbed#setAuthor is deprecated

I’m working on a discord bot, when a user joins/leaves the server there’s a message for that, but I’m getting a warning in my terminal that says
DeprecationWarning: Passing strings for MessageEmbed#setAuthor is deprecated

Here is some of the code in case you need it.

const Welcome = new MessageEmbed()
    .setColor("RED")
    .setAuthor(user.tag, user.avatarURL({dynamic: true, size: 512}))
    .setThumbnail(user.avatarURL({dynamic: true, size: 512}))
    .setDescription(`
    Welcome ${member} to **${guild.name}!**`)
    .setFooter({
      text: `${user.id}`
    })

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

It’s just a deprecation warning. You can safely ignore it.

It means that in a future version of the Discord client, you won’t be able to use the function setAuthor.

There’s usually a replacement function or alternate method for it in newer versions but if you don’t plan on upgrading then you can ignore it.

You should, however, always upgrade your dependencies as they can contain bug fixes and security updates.

In your case, Discord specifies that setAuthor accepts an object in newer versions (although you can still use a string in your version).

Check the Discord JS Docs for more information.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading