我希望能够输入“ $ 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
答案 0 :(得分:0)
尝试将ID分配给类似这样的变量
const testChat = '607370435553918977';
client.channels.get(testChat).overwritePermissions