为了账号安全,请及时绑定邮箱和手机立即绑定

如何使用“overwritePermissions”功能打开某个频道的权限?

如何使用“overwritePermissions”功能打开某个频道的权限?

元芳怎么了 2021-09-04 17:23:02
我希望能够输入“$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 回答

?
慕妹3242003

TA贡献1824条经验 获得超6个赞

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


const testChat = '607370435553918977';

client.channels.get(testChat).overwritePermissions


查看完整回答
反对 回复 2021-09-04
  • 1 回答
  • 0 关注
  • 150 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信