Adding an entire role to a private thread
Hello - I am making a private thread, and I know how to add a particular user to it - is there anyway to add an entire role? If not, how can I efficiently unpack the users with the role and add them to the thread?
10 Replies
• What's your exact discord.js
npm list discord.js
and node node -v
version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.Mention the role?
doesn't actually add them, I believe this only works for public threads?
Yeah they would need access to the channel/thread before hand. Then you can change the channel/thread permissions after they're added?
Other way would be to fetch the role and iterate the members and add them that way, but that might be API spam
Best option would be
create public thread > mention role to add members > make private
ahhh
let me try that, thanks!
I don't believe discord.js lets you modify type after creation?
it doesn't appear in the edit options, and I don't see a setType anywhwere
https://discord.js.org/#/docs/discord.js/main/class/ThreadChannel
Are you referring to threads in a text channel, or in a forum channel?
You would have to make the parent channel public/private
so its a text channel
the parent channel is already publicly viewable
To explain better, I mean;
- if you create a private thread in a public channel you can mention a role that has access to the channel and those members will be added
- if you create any thread (public or private) in a private channel mentioning a role that doesn't have access to the parent channel won't work
So, if the parent channel is public to everyone, create a private thread and mention the role you want to add. I hope that makes more sense
Hmm I'll try this again - to be clear, the channel doesn't have to be fully public as long as the role I'm trying to add has access to it, right?
Correct