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

611
Views
How mention on discord.js

please help, how to mention the user in the message? I can't find the answer on the internet. my code:

  const exampleeEmbedd = new MessageEmbed()
  .setColor('#53db56')
  .setTitle('  [👋] Приветствуем нового путника!')
  .setDescription(' Приветствуем вас ' + /*MENTION*/ + '!\nДобро пожаловать на международный сервер режима Geopolitics. \nЗдесь вы можете присоеденится к существующему городу/государству, либо зарегистрировать свой город/государство.')
  .setURL('')
  .setAuthor('👑Имперский Бот👑', 'https://images-ext-2.discordapp.net/external/nWASMV-67mx7guRheeUpvyD_cb6X2NkxUMH4PtbweyA/%3Fsize%3D512/https/cdn.discordapp.com/avatars/916617120064884796/5028d4861b407575072686657b3c2e9a.png' )
  .setThumbnail(user.avatarURL())
  .addFields(
  )
  .setImage('')
  .setTimestamp()
  .setFooter('asdas', 'https://images-ext-2.discordapp.net/external/nWASMV-67mx7guRheeUpvyD_cb6X2NkxUMH4PtbweyA/%3Fsize%3D512/https/cdn.discordapp.com/avatars/916617120064884796/5028d4861b407575072686657b3c2e9a.png');
  mess.channel.send( { embeds: [exampleeEmbedd] } );
about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Discord.js converts mentions for you automatically when interpreted as a string.

"Foo" + user + "Bar" converts to Foo<@!1234567890>Bar.

Using template strings:

`Foo${user}Bar`

In cases where you only have the user ID, you can do this manually:

"Foo<@!" + userId + ">Bar"
// or
`Foo<@!${userId}>Bar`

Ensure that userId is a string.

about 4 years ago · Juan Pablo Isaza Report

0

You need to use a ${user} string or ${user.tag}, so your bot will mention a user.

Make sure you placed let user = message.mentions.members.first() above the embed

The example:

   const exampleeEmbed = new MessageEmbed()
  .setTitle('an embed')
  .setDescription(`Hello ${user}!`)
  mess.channel.send({ embeds: exampleeEmbed });

Also make sure you enclose your message as ``

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!