I'm trying to create a new channel and overwrite the permissions of @everyone
so that only a selected role has access to the channel. No matter what I try it seems that the channel permissions remain unchanged. Last 2 attempts :
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);
I'm trying to create a new channel and overwrite the permissions of @everyone
so that only a selected role has access to the channel. No matter what I try it seems that the channel permissions remain unchanged. Last 2 attempts :
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);
Share
Improve this question
edited Mar 27, 2018 at 13:25
p-a-o-l-o
10.1k2 gold badges24 silver badges36 bronze badges
asked Sep 22, 2017 at 15:02
TraxTrax
1,5587 gold badges22 silver badges43 bronze badges
1
- Did you mean that you want the bot to create a channel, which only people with roles can see it? And those without roles cannot see the channel? – WQYeo Commented Sep 22, 2017 at 15:47
1 Answer
Reset to default 4The ID field had to be a string.
Guild.createChannel(permName, 'text',[{
type: 'role',
id:'359999680677019649',
deny:0x400
}])
.then(channel => console.log(`Created new channel ${channel}`))
.catch(console.error);