Ping outside embed

How do I ping a user outside the embed?
9 Replies
d.js toolkit
d.js toolkit2y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
zevnda
zevnda2y ago
Few different ways; - include the user/member object in your message content - include a mention such as <@user_id> - use the userMention(user_id) method (import from discord.js)
d.js docs
d.js docs2y ago
You can control which entities receive notifications via the allowedMentions option. You can: • Set a default on the client • Set for a specific message • Use the repliedUser key to disable in-line reply mentions
{ ..., allowedMentions: { parse: ["users", "roles"] } }
{ ..., allowedMentions: { parse: ["users", "roles"] } }
Cristiano®
Cristiano®OP2y ago
I am doing it this way how can I do it?
zevnda
zevnda2y ago
When you send your embed, include the content property
channel.send({
content: `userMention(user_id)`,
embeds: [embed]
});
channel.send({
content: `userMention(user_id)`,
embeds: [embed]
});
Cristiano®
Cristiano®OP2y ago
One last thing, on .setDescription how can I add what on discord we normally do with ? because if I enter `` it doesn't work. Example`
zevnda
zevnda2y ago
You need escape the characters using backslashes, or you can use the inlineCode() method
zevnda
zevnda2y ago
Cristiano®
Cristiano®OP2y ago
Thank you. Working, thank you so much.

Did you find this page helpful?