I'm having a problem where my bot does not mention correctly in rich embeds. It appears to be unable to tag a user at all.
A mention ends up looking like...
<@601756839956447232>
It should ping the user and look like...
author.toString()
in my message.<@${author.id}>
.@${author.tag}
.${author}
.All of these attempts produce the same result.
This is the code I'm using...
var serv = message.guild
var author = message.author
var myInfo = new discord.RichEmbed()
.setAuthor(`${serv.name}'s roles`,`${message.guild.iconURL}`)
.addField(`Roles`, serv.roles.map(r => `${r}`).join(' | '),true)
.setColor(0xffd000)
.setFooter('Server Roles.')
.setFooter(`Requested by @${author.tag}`,`${author.avatarURL}`)
message.channel.sendEmbed(myInfo);
My main goal here is to tag the user in the embed message without tagging the user. My main focus is to get https://imgur.com/a/hbgm1TX to https://imgur.com/a/lB1Moh9 but the ping does NOT actually ping anyone located in the embed.
An estimated 84 percent of communications will be visual by 2018. Adding rich media embeds to your Bit document allows your documents to have a visual dimension to them. The best part is you aren’t causing your audience to click on a bunch of links that open up multiple windows.
1 Answer 1 ActiveOldestVotes 13 These text-based properties of RichEmbeds (v11) and MessageEmbeds (v12) do notsupport mentions... Author Title Field Name Footer These don't even support any markdown... Author Footer Because a footer can't parse the mention, it shows up as the string you see.
Let’s look at some examples of how these presentation rich media embeds look and feel in a Bit document: If you are an avid user of SlideShare, you can embed it directly in your Bit document by simply pasting the URL of your file in your document. Here’s an example of what a SlideShare would look inside a Bit document:
Because a footer can't parse the mention, it shows up as the string you see. Also, a user will not be given a notification for their mention in any part of an embed. Finally, the TextChannel#sendEmbed()method is deprecated and has been removed in v12 of Discord.js; use TextChannel#send().
These text-based properties of RichEmbeds (v11) and MessageEmbeds (v12) do not support mentions...
These don't even support any markdown...
Because a footer can't parse the mention, it shows up as the string you see. Also, a user will not be given a notification for their mention in any part of an embed. Finally, the TextChannel#sendEmbed()
method is deprecated and has been removed in v12 of Discord.js; use TextChannel#send()
.
This code will use the author's tag instead of trying to parse a mention in the footer. If you want to use the user's mention without pinging them, you can place it in any part of the embed not listed above. Otherwise, their mention must be part of the message content.
var myInfo = new discord.RichEmbed() // v11 only
.setColor(...)
.setAuthor(...)
.addField(...)
.setFooter(`Requested by ${message.author.tag}.`, message.author.displayAvatarURL);
message.channel.send(myInfo)
.catch(console.error);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With