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

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

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 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