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
d.js toolkit
d.js toolkit2y ago
• 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.
probablyraging
Mention the role?
Tyranasaurus
TyranasaurusOP2y ago
doesn't actually add them, I believe this only works for public threads?
probablyraging
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
Tyranasaurus
TyranasaurusOP2y ago
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
probablyraging
Are you referring to threads in a text channel, or in a forum channel? You would have to make the parent channel public/private
Tyranasaurus
TyranasaurusOP2y ago
so its a text channel the parent channel is already publicly viewable
probablyraging
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
Tyranasaurus
TyranasaurusOP2y ago
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?
probablyraging
Correct
Want results from more Discord servers?
Add your server