我希望能够输入“$unlock”并解锁某个频道的权限。我不知道如何将 ID 转换为文本通道 ID。switch (args[0]) { case "unlock": if(!message.member.roles.find(r => r.name === "Unlockable")) return message.channel.sendMessage('You do not have permission to use this command.') const textChannell = ('607370435553918977'); if (!textChannell) { console.log('Please support a unlock channel ID.'); } textChannell.overwritePermissions(message.author, { //I also want to change the everyone role, not just the author of the message SEND_MESSAGES: true, VIEW_CHANNEL: true }) .then(updated => console.log(updated.permissionOverwrites.get(message.author.id))) break; }我希望它更改 textchannell 的 ID 权限,但出现以下错误:TypeError: textChannell.overwritePermissions is not a function
1 回答
![?](http://img1.sycdn.imooc.com/54586870000183e302200220-100-100.jpg)
慕妹3242003
TA贡献1824条经验 获得超6个赞
尝试将 id 分配给这样的变量
const testChat = '607370435553918977';
client.channels.get(testChat).overwritePermissions
添加回答
举报
0/150
提交
取消