Simplifying API Requests
Here's the code I'm using:
It works well, but I have one question: Is there a way to send requests without specifying the method? I'd like to just send requests to the endpoint without specifying the method each time.
6 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!
- ✅
Marked as resolved by OP$ npm list discord.js && node -v
[email protected] C:\Program Files\Git\projects\botstudio
└── [email protected]
v22.1.0
I just want to see if it's possible to not specify the request method each time when sending requests.
Perhaps consider leveraging one of Discord.js's built-in methods to determine the required request method for each endpoint.
If you're using discord.js, use tools it provides
Else you can use
@discordjs/core
Thanks! That's exactly what I meant, but can I use it without installing another package? Just using 'discord.js'
Currently
discord.js
doesn't include /core
Thanks; I've got my answers.