How can I create a private thread? ([email protected])
I tried this type: "GUILD_PRIVATE_THREAD" and that type: ChannelType.PrivateThread, both didn't work. Thanks for help!
5 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!error?
no error in both cases
show code
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