我试图创建一个通道,默认情况下,它允许某些角色访问并阻止@everyone,但我也希望它能与类别一起工作,例如允许其他角色
let specificOverwrites = [
...members,
{
id: creatorRoleId,
allow: [PermissionFlagsBits.ViewChannel]
},
{
id: interaction.guild.roles.everyone.id,
deny: [PermissionFlagsBits.ViewChannel]
}
];
// Use specificOverwrites during channel creation
const channel = await interaction.guild.channels.create({
name: allianceNameInput,
type: ChannelType.GuildText,
parent: alliancesCategory.id,
permissionOverwrites: specificOverwrites
});
字符串
上面的代码是我目前拥有的,但它忽略了类别权限。我如何使它与类别权限一起工作?
1条答案
按热度按时间bvjveswy1#
您可以Map父类别的
permissionOverwrites
,并将Map的权限添加到specificOverwrites
数组。字符串