What Im doing wrong?

im trying to make a request trough API but instead I got 403 error everytime I try
const { get, post } = require('axios');
let { data } = await get(`https://discord.com/api/users/${message.author.id}/profile?guild_id=${message.guild.id}`,
{
headers:
{
"Authorization": "Bot " + TOKEN,
"Content-Type": "application/json"
}
});
message.reply(data);
const { get, post } = require('axios');
let { data } = await get(`https://discord.com/api/users/${message.author.id}/profile?guild_id=${message.guild.id}`,
{
headers:
{
"Authorization": "Bot " + TOKEN,
"Content-Type": "application/json"
}
});
message.reply(data);
4 Replies
d.js toolkit
d.js toolkit10mo ago
- 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 staff
kin.ts
kin.ts10mo ago
403 means "Forbidden", what r u trying to do?
TRKako
TRKakoOP10mo ago
damn, sorry, thx anyways
darp
darp10mo ago
GET /users/{user.id}/profile is user-only endpoint
Want results from more Discord servers?
Add your server