我正在制作一个可以通过请求更改网址代码的机器人,但是我已经尝试了一些方法,并且只返回了当前的邀请代码
我的代码:
fetch('https://www.discord.com/api/v6/guilds/762359120031907871/vanity-url', {
method: 'POST',
headers: { 'Authorization': 'Bot ' + client.token, 'Content-Type': 'application/json'},
payload: JSON.stringify({
"code":"test458"
})
})
.then(res => res.json())
.then(json => { console.log(json)})
它正在返回
{ code: 'cherrys', uses: 0 }
我只想更改代码,但是idk我该怎么做,当我尝试使用用户令牌时说
401: Unauthorized
有人可以帮我吗?