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
How can I pull data from an API into a Discord Embed Message?

I am trying to pull data from an API using GET to display that information in a nice Discord Embed message that updated frequently. How can I use the information it gives me and display it in a discord embed?

Also, how can I make it so that an ID is instead shown as a Name instead of the ID itself?

The APIs I want to use are all here in this repo https://github.com/ToontownRewritten/api-doc

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

0

Just use node-fetch or JavaScript fetch() function

Here is an example (this is a very simplified example and probably will need big adjustments to work properly with your API, as an API requires authentication and no headers were mentioned on this fetch request):

fetch('url')
  .then((response) => {
    return response.json()
  })
  .then((data) => {
    console.log(data)
    const embed = new Discord.MessageEmbed()
    .setTitle('hi')
    .setDescription(data)
    message.channel.send(embed)
  })
  .catch((err) => {
    // Do something for an error here
  })

You change this to your needs, but just to give you a general idea.

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