2017-09-22 37 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);