Create thread linked to message

Hey ! I want to create a thread that is link to a message, but the function startThread as an error (console say it's not a function). Thanks in advance Mysterious_Dev
5 Replies
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Mysterious_Dev
Mysterious_DevOP3y ago
Oh yes, sorry
const suggestion_channel = client.channels.cache.get(SUGGESTIONS_CHANNEL);
const embed = new EmbedBuilder()
.setTitle(`${interaction.fields.getTextInputValue("suggestion_name")}`)
.setColor("#15ff67")
.setAuthor({ name: `${name}`, iconURL: `${avatarUrl}` })
.setDescription(`${interaction.fields.getTextInputValue("suggestion_description")}`)

let message = await suggestion_channel.send({embeds: [embed]}).then(msg => {
msg.react("✅")
msg.react("❎")
});

await message.startThread({
name: 'food-talk',
autoArchiveDuration: 60,
reason: 'Needed a separate thread for food',
});


await interaction.reply({ content: "Votre suggestion a bien été prise en compte", ephemeral: true });
const suggestion_channel = client.channels.cache.get(SUGGESTIONS_CHANNEL);
const embed = new EmbedBuilder()
.setTitle(`${interaction.fields.getTextInputValue("suggestion_name")}`)
.setColor("#15ff67")
.setAuthor({ name: `${name}`, iconURL: `${avatarUrl}` })
.setDescription(`${interaction.fields.getTextInputValue("suggestion_description")}`)

let message = await suggestion_channel.send({embeds: [embed]}).then(msg => {
msg.react("✅")
msg.react("❎")
});

await message.startThread({
name: 'food-talk',
autoArchiveDuration: 60,
reason: 'Needed a separate thread for food',
});


await interaction.reply({ content: "Votre suggestion a bien été prise en compte", ephemeral: true });
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Mysterious_Dev
Mysterious_DevOP3y ago
Thanks, It was indeed my message that was null, I moved the startThread in the then function
Unknown User
Unknown User3y ago
Message Not Public
Sign In & Join Server To View
Want results from more Discord servers?
Add your server