I'm trying to fetch my guild info from discord API
fetch('https://discord.com/api/guilds/772037458996101140', {
headers: {
authorization: 'bot Nzc******zNjYzOTAz.GPwhCV.rhIcH****5R8ZS-cIo4MjPcBVxO6wYsUXhY'
},
})
.then(result => result.json())
.then(response => {
console.log(response);
})
.catch(console.error)
Only receiving 401 (unauthorized)
I tried changing "bot" to "BOT", "Bot", "Bearer" and doing authorization using access token from Oauth2.