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

144
Vistas
Not checking anything before or after the string "welcome"

So I'm trying to have javascript match only the string "welcome" with a message containing that however I don't want it to only react when someone says "welcome" exactly. I think I have to use regex for this but I'm not sure and I've been pretty confused on it.

    if (message.content.toLowerCase() == 'welcome') {
     message.react(reactEmoji)
    }

Theres my code. I've tried a few different versions of regex like "/welcome/i" however that did not work

I want something like the image below to get reacted on like this 1

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

0

Get the lowercase version of it and run String#includes() on it.

if (message.content.toLowerCase().includes('welcome')) {
    message.react(reactEmoji)
}

Or you can use regex

if (/welcome/i.test(message.content)) {
    message.react(reactEmoji)
}
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