Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

159
Vistas
How to get "snowflake" value for user_id?

I'm trying to write a command that messages a specified user. The user can type something like /warn @user insert warning here. Here is the code:

    const user = await client.users
      .fetch(interaction.options.getString("user"))
      .catch(console.error);

    const embed = new MessageEmbed()
      .setColor("#FCE100")
      .setTitle(`⚠️ Warning!`)
      .setDescription(`${interaction.options.getString("warning")}`);
    await user.send({ embeds: embed }).catch(() => {
      interaction.channel.send("Error: user not found");
    });

Here's the error I'm getting:

user_id: Value "<@!9872345978#####>" is not snowflake.

How do I get the correct "snowflake" value to actually be able to DM the user?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You have to use getUser instead of getString and also change your user option type to "USER" to make it work!

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda