DiscordAPIError: Invalid Form Body when trying to send embeds

This is one of the first commands I wrote whilst I've been learning, and recently it stopped working. I fiddled with it a little, but can't see where the problem comes from. When I run ~userinfo the following error comes up in the console:

Unhandled Rejection at: DiscordAPIError: Invalid Form Body
embed.footer.icon_url: Not a well formed URL.

This is the code for userinfo:

 if (command === 'userinfo') { var embed = new Discord.RichEmbed() .setTitle('User Info') .addField('Username', message.author.tag) .addField('Server', message.guild.name) .setColor(0xFF8AFF) .setThumbnail(message.author.avatarURL) .setFooter('Akasuki', version, client.user.avatarURL); message.channel.send(embed); }

Changing message.channel.send() to message.channel.sendEmbed() brings up errors, and there's been nothing wrong with using send() so far.

Also, this isn't necessary but if anyone knows how to add when the users account was created, to this embed it would be very helpful. Or even a resource or couple? Thanks for reading.

2

1 Answer

Used Cursed's solution (in comments):

"Change .setFooter('Akasuki', version, client.user.avatarURL); to .setFooter(`Akasuki ${version}`, client.user.avatarURL);"

Works perfectly! Thank you so much!

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like