const guildMembersResponse = fetch(`http://discordapp.com/api/guilds/440494010595803136/members/278628366213709824`,
{
method: 'PUT',
headers: {
Authorization: `Bearer TOKEN`,
},
});
setTimeout(() => {
console.log(guildMembersResponse)
}, 500);
我想使用他的用户 ID 和他在 nodejs 中的令牌将用户加入我的 Discord 服务器,但是如果我请求 Dicord api,我会收到错误消息:
Promise {
Response {
size: 0,
timeout: 0,
[Symbol(Body internals)]: { body: [PassThrough], disturbed: false, error:
null },
[Symbol(Response internals)]:
{ url:
'https://discordapp.com/api/guilds/440494010595803136/members/278628366213709824',
status: 401,
statusText: 'UNAUTHORIZED',
headers: [Headers] } } }
我正在使用节点获取库!