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

268
Visualizações
How do you make a Discord bot send an emoji when you give it the name of the emoji?

I'm trying to make my Discord bot send an emoji when I tell it the name. E.g., say I send !emoji hello, I want the bot to send back the emoji called hello.

If I send an emoji the bot will send it back but I'm not sure how to grab an emoji from its name being sent to the bot.

I use discord.js v12 for reference.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

You could try something like this

bot.on("messageCreate", (message) => {
    const exampleEmoji = message.guild.emojis.cache.find(emoji => emoji.name === message.content);
    channel.message.send(`Is this the emoji you want? ${exampleEmoji}`);
});

You can then nest it inside of your if statement as you please with whatever command you are using. This also should be v12/v13 compatible and I believe the only differences with older versions is whether you add cache or not to the find function.

You can also use the same function to find the emoji as a boolean to determine if the emoji exists or not and if not send a different message for feedback.

I also found this really interesting function which helped me when deciphering which emojis I have and which are not in the scope I am presenting.

if (message.content === "listemojis") {
   const emojiList = message.guild.emojis.cache.map((e, x) => `${x} = ${e} | ${e.name}`).join("\n");
   message.channel.send(emojiList);
}

Which will output this for every emoji within the scope you searched.

450661466287112204 = :image: | name

Which I found here. Hope this helps

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