admin管理员组文章数量:1327329
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);
本文标签: javascriptCreate and overwrite channel permissions with DiscordjsStack Overflow
版权声明:本文标题:javascript - Create and overwrite channel permissions with Discord.js - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742199850a2431734.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论