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

136
Vistas
A way to get the exact discord message content

If you type :a: or :gun:, it sends an emote in discord. What I'm trying to do, is if someone sends just the string that is in between those : (that is, in this case, I showed, 'a' or 'gun'), my bot would analyze it and check if it can be 'translated' to an emote.

I tried to do:

if (msg.content.length === 1)

But msg.content keeps on being :(string): so it doesn't work.

I am currently searching for other ways and will keep this updated. Any tips will be highly appreciated!

Edit: Went with this api as I found no other way

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

0

There are a couple caveats with this: 1) There does not appear to be anyway of checking against standard emojis; only guild (i.e. custom) emojis. 2) It may be possible with a 3rd-party plugin.

Regarding #1, this will translate a message into a GUILD emoji:

const emoji = message.guild.emojis.cache.find(e => e.name === message.content);
    
if (emoji) {
    message.channel.send(`<:${emoji.name}:${emoji.id}>`);
}

Regarding #2, check out emoji-regex. From what I can tell, convert the message to an emoji, and compare it to what emoji-regex tells you. If it matches, then you can send the emoji.

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