How can I deny @everyone and allow the author to view the channel?
You can either use roles.everyone
that returns the @everyone
role of the guild or simply use the guild's ID. Also, your overwrites are incorrect. It should contain two objects; one that denies views for everyone, and one that allows it for the member who sent the message.
Any of these will work:
let permissionOverwrites = [
{
id: message.guild.roles.everyone.id,
deny: ['VIEW_CHANNEL'],
},
{
id: message.author.id,
allow: ['VIEW_CHANNEL'],
},
];
let channel = await guild.channels.create(
`${message.author.username}-${message.author.discriminator}`,
{
parent: 'took out ID',
topic: `Support for ${message.author.tag} | ID: ${message.author.id}`,
permissionOverwrites,
},
);
Or:
let permissionOverwrites = [
{
id: message.guild.id,
deny: ['VIEW_CHANNEL'],
},
{
id: message.author.id,
allow: ['VIEW_CHANNEL'],
},
];
let channel = await guild.channels.create(
`${message.author.username}-${message.author.discriminator}`,
{
parent: 'took out ID',
topic: `Support for ${message.author.tag} | ID: ${message.author.id}`,
permissionOverwrites,
},
);