Node.js 如何使用Discord Rest API按id获取公会

Node.js 如何使用Discord Rest API按id获取公会,node.js,api,rest,discord,Node.js,Api,Rest,Discord,我想得到一个特定的不和谐公会的id测试,如果我的用户有权添加机器人对他们公会 我尝试使用https://discord.com/api/v8/users/@me/guilds和参数在之前和之后。 但id是雪花/字符串,我使用nodeJs,所以不可能执行:-1 我当前的代码: const id=“xxxxxxxxxx”, before=id+1,//不工作,因为它是字符串和大int after=id-1//相同 ; 常量url=`https://discord.com/api/v8/users/@

我想得到一个特定的不和谐公会的id测试,如果我的用户有权添加机器人对他们公会

我尝试使用
https://discord.com/api/v8/users/@me/guilds
和参数
之前和
之后。
但id是雪花/字符串,我使用nodeJs,所以不可能执行:-1

我当前的代码:

const id=“xxxxxxxxxx”,
before=id+1,//不工作,因为它是字符串和大int
after=id-1//相同
;
常量url=`https://discord.com/api/v8/users/@me/guilds?before=${before}和after=${after}`;
获取(url{
标题:{
“授权”:“持有人XXXXXXXXXX”,
}
})
.then(res=>res.json())
.then(json=>console.log(json));

想法?谢谢。

你能发布你的代码吗?或者你尝试了什么?@JatinMehrotra对不起,我用代码编辑了我的帖子。