create channel overrides adds to interaction.channel instead

When creating a channel with permissions overrides, it seems to add the overrides to the channel from where interaction Here is the code I used, but the perm overrides are added to the channel from where the interaction is made in...
const channel = await interaction.guild.channels.create({
name: `ticket-${interaction.user.username}`,
topic: `${channelTopic} for ${interaction.member}`,
type: ChannelType.GuildText,
parent: categoryChannel,
permissionOverwrites: [
{
id: interaction.member.id,
allow: GenerateTicketUserPerms(),
},
{
id: interaction.guild.id,
deny: [PermissionFlagsBits.SendMessages, PermissionFlagsBits.ViewChannel],
},
{
id: supportRole.id,
allow: [PermissionFlagsBits.SendMessages, PermissionFlagsBits.ViewChannel],
},
],
});
const channel = await interaction.guild.channels.create({
name: `ticket-${interaction.user.username}`,
topic: `${channelTopic} for ${interaction.member}`,
type: ChannelType.GuildText,
parent: categoryChannel,
permissionOverwrites: [
{
id: interaction.member.id,
allow: GenerateTicketUserPerms(),
},
{
id: interaction.guild.id,
deny: [PermissionFlagsBits.SendMessages, PermissionFlagsBits.ViewChannel],
},
{
id: supportRole.id,
allow: [PermissionFlagsBits.SendMessages, PermissionFlagsBits.ViewChannel],
},
],
});
3 Replies
d.js toolkit
d.js toolkit5mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
Miniontoby
MiniontobyOP5mo ago
It is the only place where I use permiisionsOverwrites in the button callback! I will get you the full code...
Miniontoby
MiniontobyOP5mo ago
Here you go. Here is the full code that is executed when the button is clicked. of course you cannot use this directly since it uses a lot of util functions and such, but yeah...
Want results from more Discord servers?
Add your server