Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

160
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda