How do i set permission override
Im trying to do
but seems like permissionOverwrites does not exist (undefined)?
13 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!
- ✅
Marked as resolved by OP14.15.2
i cant access permissionOverwrites on any channel type
can you show how you defined
channel
if the error is "cannot read properties of undefined (reading permissionOverwrites)", then channel is undefined, not permissionOverwrites
Nah says edit is undefined
So permission override is undefined
I tried all channel types idk whats the problem
Please share the full error rather than paraphrasing it
Ok…1 sec
and also what Svitkona mentioned, how are you defining channel
so its in a loop
Property 'permissionOverwrites' does not exist on type 'NewsChannel | StageChannel | TextChannel | PrivateThreadChannel | PublicThreadChannel<boolean> | VoiceChannel'.
Property 'permissionOverwrites' does not exist on type 'PrivateThreadChannel'.
well as the error says, private threads don't have a permission overwrites
Add this typeguard along with your other one to exclude threads
same thing
if (!channel.isThread()) continue;
channel.permissionOverwrites.edit("", { ViewChannel: false });
wait
sorryu
! was the problem ty for ur help