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 work17 Replies
- 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!node version: v20.17.0
how does "doesn't work" manifest?
[email protected]
like it's not denying the permission to view the channel
you are sure that you saved your code before you ran it?
yes
i'm sure
very sure
oh, duh
type member, but guild.id is the at-everyone role id
i've even tried the role type
doesn't work either
just omit the type
let me try again with myself this time
well, i just tried, both without and with role specified explicitly it worked, with member it did not
still don't work
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 channeloh
i didn't know that
thank you sir
ok yeah that was the issue
thanks
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
parent
key