gpt4 book ai didi

javascript - 如何使用 'overwritePermissions' 函数打开某个 channel 的权限?

转载 作者:行者123 更新时间:2023-11-30 06:13:45 25 4
gpt4 key购买 nike

我希望能够输入“$unlock”并解锁某个 channel 的权限。我不知道如何将 ID 变成文本 channel 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;
}

我希望它更改文本 channel 的 ID 权限,但出现以下错误:

TypeError: textChannell.overwritePermissions is not a function

最佳答案

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

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

关于javascript - 如何使用 'overwritePermissions' 函数打开某个 channel 的权限?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57363474/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com