Javascript 如何使用';覆盖权限';函数打开某个频道';s的权限?

Javascript 如何使用';覆盖权限';函数打开某个频道';s的权限?,javascript,discord.js,Javascript,Discord.js,我希望能够键入“$unlock”并解锁某个频道的权限。我不知道如何将ID转换为文本频道ID 开关(参数[0]){ “解锁”案例: 如果(!message.member.roles.find(r=>r.name==“Unlockable”))返回message.channel.sendMessage('您没有使用此命令的权限') const textChannell=('60737043553918977'); 如果(!textchannel){ console.log('请支持解锁通道ID');

我希望能够键入“$unlock”并解锁某个频道的权限。我不知道如何将ID转换为文本频道ID

开关(参数[0]){
“解锁”案例:
如果(!message.member.roles.find(r=>r.name==“Unlockable”))返回message.channel.sendMessage('您没有使用此命令的权限')
const textChannell=('60737043553918977');
如果(!textchannel){
console.log('请支持解锁通道ID');
}
textchannel.overwritePermissions(message.author,{//我还想更改everyone角色,而不仅仅是消息的作者
发送消息:正确,
查看频道:真
})
.then(updated=>console.log(updated.permissionOverwrites.get(message.author.id)))
打破
}
我希望它更改textchannell的ID权限,但我收到以下错误:

TypeError: textChannell.overwritePermissions is not a function

尝试将id分配给这样的变量

const testChat = '607370435553918977';
client.channels.get(testChat).overwritePermissions

我有额外的l,因为我在代码前面定义了它。@MrAuro我已经编辑了我的答案。这段代码目前在我的一个机器人上运行。