permissionOverwrites on a new channel

so i was creating a ticket system, and when a ticket is made, a channel is made based by the ticket. the problem is: whenever i try to make it so that only the one who made the ticket can see the channel and no one else can, it doesn't work i've even tried putting as the type OverwriteTypes.Role but it still doesn't work
No description
No description
No description
No description
17 Replies
d.js toolkit
d.js toolkit2mo 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!
Nab Heyka
Nab HeykaOP2mo ago
node version: v20.17.0
souji
souji2mo ago
how does "doesn't work" manifest?
Nab Heyka
Nab HeykaOP2mo ago
[email protected] like it's not denying the permission to view the channel
souji
souji2mo ago
you are sure that you saved your code before you ran it?
Nab Heyka
Nab HeykaOP2mo ago
yes i'm sure very sure
souji
souji2mo ago
oh, duh type member, but guild.id is the at-everyone role id
Nab Heyka
Nab HeykaOP2mo ago
i've even tried the role type doesn't work either
souji
souji2mo ago
just omit the type
Nab Heyka
Nab HeykaOP2mo ago
let me try again with myself this time
souji
souji2mo ago
well, i just tried, both without and with role specified explicitly it worked, with member it did not
Nab Heyka
Nab HeykaOP2mo ago
still don't work
No description
No description
NyR
NyR2mo ago
it's because you are setting the parent channel after you create it using setParent, the method locks the permission to the category by default, just pass the parentId when creating the channel
Nab Heyka
Nab HeykaOP2mo ago
oh i didn't know that thank you sir ok yeah that was the issue thanks
souji
souji2mo ago
so 1) that default is fluffed up has been the case since 2017 tho so then i tried to understand why i never ran into this - the answer is: i never use it. which begs the question: why do you even move it? you can also specify a parent in the #create call
d.js docs
d.js docs2mo ago
:interface: GuildChannelCreateOptions @14.16.3 Options used to create a new channel in a guild.
souji
souji2mo ago
parent key
Want results from more Discord servers?
Add your server