How can I create a private thread? (discord.js@14.14.1)

I tried this type: "GUILD_PRIVATE_THREAD" and that type: ChannelType.PrivateThread, both didn't work. Thanks for help!
5 Replies
d.js toolkit
d.js toolkit3mo 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!
darp
darp3mo ago
error?
Abwegig
Abwegig3mo ago
no error in both cases
darp
darp3mo ago
show code
Abwegig
Abwegig3mo ago
if (interaction.customId === "selectReasonMenu") { const selectedValue = interaction.values[0]; console.log(Ausgewählter Wert: ${selectedValue}); interaction.channel.threads .create({ name: Ticket - ${selectedValue}, autoArchiveDuration: 1440, type: ChannelType.PrivateThread, reason: Thread für das Ticket mit dem Grund: ${selectedValue}, startMessage: interaction.message, }) .then(async (thread) => { const threadChannel = await interaction.guild.channels.fetch( thread.id ); await thread.members.add(interaction.user.id); }) .catch(console.error); } okay, thanks