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