2017-09-22 41 views
0

我试图创建一个新通道并覆盖@everyone的权限,以便只有选定的角色才能访问该通道。无论我尝试什么,似乎频道权限保持不变。最后2次尝试:discord.js创建并覆盖通道权限

Guild.createChannel(permName, 'text',[{ 
    type: 'role', 
    id:359999680677019649, 
    deny:0x400 
    }]) 
    .then(channel => console.log(`Created new channel ${channel}`)) 
    .catch(console.error); 

///////// 

    Guild.createChannel(permName, 'text',[{ 
    type: 'role', 
    id:359999680677019649, 
    permissions:1024 
    }]) 
    .then(channel => console.log(`Created new channel ${channel}`)) 
    .catch(console.error); 
+0

你是不是说你想让机器人创建一个只有角色的人才能看到的频道?那些没有角色的人看不到频道? – WQYeo

回答

1

ID字段必须是字符串。

Guild.createChannel(permName, 'text',[{ 
    type: 'role', 
    id:'359999680677019649', 
    deny:0x400 
    }]) 
    .then(channel => console.log(`Created new channel ${channel}`)) 
    .catch(console.error);