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 toolkit3mo 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.ts3mo ago
403 means "Forbidden", what r u trying to do?
TRKako
TRKako3mo ago
damn, sorry, thx anyways
darp
darp3mo ago
GET /users/{user.id}/profile is user-only endpoint